dorado上动态添加按钮和按钮绑定dataset

    技术2022-05-12  19

    动态添加钮 var number = 0; function generaterButtons() {   number++;   var windowContainer = document.getElementById("windowContainer");    var textValue = windowContainer.innerHTML;   textValue += " <input name='btn"+number+"'  id='btn"+number+"' type='button' value='代码段"+number+"' onClick = 'bindRecord(name)' style='cursor: pointer;font-family: Verdana;font-size: 9pt;height: 22;border-width: 1;border-color: #CCCCCC;border-style: solid;background-color: buttonface;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFFFFF, endColorstr=#DDDDDD);'>";   windowContainer.innerHTML = textValue; } 按钮绑定dataset的记录 function bindRecord(btnName) {   var str = btnName.replace("btn","");   dataset_Codesegment_Add.setCurrent(dataset_Codesegment_Add.find(["num"],[str])); }

    最新回复(0)