1 功能预览
2html 代码
<span> <tr> <td> <img onclick = "addType ()" src = "$ {msurl} /images/logo/add.png"> 产品范围 : </td> <td> <sélectiond id = "selectTypeone" data-options = "requis: true"> <option> 一级分类 </ option> </potion> data-options = "requise: true"> <option selected = "select"> 全部 </ option> </ select> </td> </tr> <tr> <td> </td> <td id = "TypeThree"> </pd> </tr> <tr> <td> </pandé> id = "TypeOnesubResult"> </ span> <hr /> </td> </tr> </span>3JS 代码
$ ('# selectTypeone'). ComboBox ({url: config.urlmap.typelist, valuefield: 'name', textfield: 'name', obligatoire: true, width: '100', onselect: function (row) {typename1 = row.name $ ('# typethree'). html ("); $ ('' # typeonate '). $ ('# SypeOnesubResult'). Html (""); ">" + row.name; $ .getjson (config.urlmap.typelist + "? Parent =" + row.id, function (data) {var typeThreename = "" pour (var i = 0; i <data.length + Data [i] .name + "Type = 'Checkbox'>" Data [i] .name} $ ('# typethree'). }); }) // 删除下标元素方式一 array.prototype.remove = function (dx) {if (isnan (dx) || dx> this.length) {return false; } pour (var i = 0, n = 0; i <this.length; i ++) {if (this [i]! = this [dx]) {this [n ++] = this [i]}} this.length - = 1} // 删除数组元素方式二 array.prototype.baoreMove = function (dx) {if (isnan (dx) || dx> this.Lenggd) {return; } this.splice (dx, 1); } var subsename = []; function clilinkType (name) {var index = sub-typename.indexof (name) if (index == -1) {subtypename.push (name); } else {subtypename.baoreMove (index); } $ ('# SypeoneSubResult'). html (sub-typename.join (",")); }