`

easyui中的checkbox

阅读更多
easyui中的chebox:
selectOnCheck:true;//点击行时选中复选框
checkOnSelect:true;//点击复选框时选中行

<table class="easyui-datagrid" title="" style="width:auto;height: auto;" id="dg"
			data-options="singleSelect:true,url:'<%=basePath %>system/person_testt.do',method:'post',toolbar: '#tb',onClickRow: onClickRow,onRowContextMenu:onRowContextMenu">
	<thead>
		<tr>
			<th data-options="field:'id',width:'15px',align:'center'" checkbox="true"></th>
		</tr>
	</thead>
</table>


//获取选中的checkbox
var checkedItems=$("#dg").datagrid("getChecked");
var id=[];
$.each(checkedItems,function(index.item){
	if(item.id!=null){
		id.push(item.id);
	}
});
alert(id);



若需要初始化时:
$(document).ready(function(){
	onLoadSuccess:function(){
		var checkedItems=$("#dg").datagrid("getRows");
		$.each(checkedItems,function(index,item){
			if(item.state=="已审核"){
				$("input[type='checkbox']")[index+1].disable=true;
			}
		});
	};
});
0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics