1 功能预览
2html l
<stan> <tr> <td> <img onclick = "addtype ()"src = "$ {msurl} /images/logo/add.png"> 产品范围 : </td> <td> <select Id = "selecttypeone"data-option = "requeS : <select> <select> <"select> < "select> <"select> < "select> <"selectTypeOne " data-options = "필수 : true"> <옵션 selected = "selected"> </옵션> </select> </td> </tr> <tr> <td> </td> <td id = "typethree"> </td> <tr> <td> </td> <td> <typeoneresult "> <typeoneresult"> id = "typeonesubresult"> </span> <hr/> </td> </tr> </span>3JS 代码
$ ( '#selecttypeone'). combobox ({url : config.urlmap.typelist, valuefield : 'name', 'textfield :'name ', 필수 : true, width :'100 ', onselect : function (row) {typename1 = row.name $ ('#typethree '); $ (') $ ( '#typeonesubresult'). html ( ""); $ ( '#selecttypetwo'). typename1 + ">" + row.name; $ .getJson (config.urlmap.typelist + "? parent =" + row.id, fort (var i = 0; i <data.length; i ++) {typethegreename + = "input onclick = clinktype (/" + data [/"). 이름 = 'typethree'value = " + data [i] .name +"type = 'checkbox'> " + data [i] .name} $ ( '#typethree'). });}})}}); }) // wray.prototype.remove = function (dx) {if (isnan (dx) || dx> this.length) {return false; } for (var i = 0, n = 0; i <this.length; i ++) {if (this [i]! = this [dx]) {this [n ++] = this.length- = 1} // 删除数组元素方式二 array.prototype.baoremove = function (dx) {iSnan (dx) | this.lx) | this. } this.splice (dx, 1); } var subtypename = []; 함수 clinktype (name) {var index = subtypename.indexof (name) if (index == -1) {subtypename.push (name); } else {subtypename.baoremove (index); } $ ( '#typeonesubresult'). html (subtypename.join ( ",")); }