1 功能预览
2html 代码
<span> <tr> <td><img onclick="addType()" src="${msUrl}/images/logo/add.png">产品范围:</td> <td><select id="selectTypeOne" data-options="required:true"> <option>一级分类</option> </select> <select id="selectTypeTwo" data-options = "requerir: true"> <opción seleccionada = "seleccionado"> 全部 </ppection> </select> </td> </tr> <tr> <tr> <td> </td> <td id = "typethree"> </td> </tr> id = "typeonesubresult"> </span> <hr/> </td> </tr> </span>3JS 代码
$ ('#selecttypeone'). comboBox ({url: config.urlmap.typeList, valuefield: 'name', textField: 'name', requerido: true, width: '100', onselect: function (fila) {100 typename1 = fila $ ('#typeonesubresult'). html (""); typename1 + ">" + row.name; name = 'typethree' value = " + data [i] .name +" type = 'checkbox'> " + data [i] .name} $ ('#typethree'). html (typethreeName); $ ('#typeoneReSult'). html (typenename ="> "); $ ('#typeoneUnsubResult'). html (html (" "" "" "" "" ". });}})}}); }) // 删除下标元素方式一 array.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 [i]} this.length -= 1} // 删除数组元素方式二 array.prototype.baoremove = function (dx) {if (iso -is (dx) || dx> this.l longitud } this.splice (dx, 1); } var subtypename = []; function clinktype (name) {var index = subtypename.indexof (name) if (index == -1) {subtypename.push (name); } else {subtypename.baoremove (índice); } $ ('#typeonesubresult'). html (subtypename.join (",")); }