CheckBoxList - jQuery LigerUI API

jQuery ligerUI

ligerCheckBoxList

复选框列表组件

示例


1 <script type="text/javascript"> 2 $(function () 3 { 4 var dataGrid = [ 5 { id: 1, name: '李三', sex: '' }, 6 { id: 2, name: '李四', sex: '' }, 7 { id: 3, name: '赵武', sex: '' }, 8 { id: 4, name: '陈留', sex: '' }, 9 { id: 5, name: '陈留2', sex: '' }, 10 { id: 7, name: '陈留3', sex: '' }, 11 { id: 6, name: '陈留4', sex: '' } 12 ]; 13 $("#checkboxlist1").ligerCheckBoxList({ 14 data: dataGrid, 15 textField: 'name' 16 }); 17 }); 18 19 function getValue() 20 { 21 var value = liger.get("checkboxlist1").getValue(); 22 alert(value); 23 } 24 function setValue() 25 { 26 liger.get("checkboxlist1").setValue("2;4"); 27 } 28 function setDisabled() 29 { 30 liger.get("checkboxlist1").set('disabled', true); 31 } 32 function setEnabled() 33 { 34 liger.get("checkboxlist1").set('disabled', false); 35 } 36 </script> 37 </head> 38 <body style="padding:10px"> 39 <div id="checkboxlist1"></div> 40 <br /> 41 <div class="liger-button" data-click="getValue" style="margin-top:9px;">获取值</div> 42 <div class="liger-button" data-click="setValue" style="margin-top:4px;">设置值(2;4)</div> 43 44 <div class="liger-button" data-click="setDisabled" style="margin-top:4px;">设置不可用</div> 45 46 <div class="liger-button" data-click="setEnabled" style="margin-top:4px;">设置可用</div> 47 </body>

截图