1 功能预览
2html 代码
<span> <tr> <td> <img onclick = "addType ()" src = "$ {msurl}/images/logo/add.png"> 产品范围: </td> <td> data-options = "ต้องการ: true"> <ตัวเลือกที่เลือก = "เลือก"> 全部 </optup> </select> </td> </tr> <tr> <td> </td> <td id = "typethree"> </td> </tr> <td> <td> id = "tyseonesubresult"> </span> <hr/> </td> </tr> </span>3JS 代码
$ ('#selecttypeone'). comboBox ({url: config.urlmap.typelist, valuefield: 'name', textfield: 'ชื่อ', ต้องการ: จริง, ความกว้าง: '100', onSelect: ฟังก์ชั่น (แถว) {typename1 = row.name $ ('# $ ('#tyseonesubresult'). html (""); + ">" + row.name; value = " + data [i] .name +" type = 'ช่องทำเครื่องหมาย'> " + data [i] .name} $ ('#typethree'). html (typethreename); $ ('#typeOneresult'). html (typename2 +"> "); $ ( - }) // 删除下标元素方式一 array.prototype.remove = function (dx) {ถ้า (isnan (dx) || dx> this.length) {return false; } สำหรับ (var i = 0, n = 0; i <this.length; i ++) {ถ้า (this [i]! = this [dx]) {this [n ++] = this [i]}} this.length -= 1} // 删除数组元素方式二 array.prototype.baoremove = ฟังก์ชันนี้ } this.splice (dx, 1); } var typename = []; ฟังก์ชั่น clinkType (ชื่อ) {var index = subtypename.indexof (ชื่อ) ถ้า (index == -1) {subtypename.push (ชื่อ); } else {subtypename.baoremove (ดัชนี); } $ ('#tyseonesubresult'). html (ชื่อย่อย. join (",")); -