1 功能预览
2HTML 代码
<span> <tr> <td> <img onClick = "AddType ()" src = "$ {msurl}/emages/logo/add.png"> 产品范围 : </td> <td> <select id = "selecttypeone" data- options = "regal" بيانات البيانات = "مطلوب: true"> <ction select = "select"> 全部 </soph> </select> </td> </tr> <tr> <td> </td> <td id = "typethree"> </td> </td> <tr> <td> <td> <td> <span id = "typeoneres" id = "typeonesubresult"> </span> <hr/> </td> </tr> </span>3JS 代码
$ ('#selecttypeone'). comboBox ({url: config.urlmap.typelist ، valuefield: 'name' ، textfield: 'name' ، market: true ، width: '100' ، onSelect: function (row) {typename1 = row.name $ ('#typeThree'). $ ('#typeonesubresult'). html ("") ؛ ">" + row.name ؛ + البيانات }) ؛ }) // 删除下标元素方式一 array.prototype.remove = function (dx) {if (isnan (dx) || dx> this.length) {return false ؛ } لـ (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) } this.splice (dx ، 1) ؛ } var subtypename = [] ؛ دالة clinktype (name) {var index = subtypename.indexof (name) if (index == -1) {subtypename.push (name) ؛ } آخر {subtypename.baoremove (index) ؛ } $ ('#typeonesubresult'). html (subtypename.join ("،")) ؛ }