1.如何添加checkbox复选框列
一定要添加idField属性
<table id="table1" class="easyui-datagrid"data-options="idField:'id'">
<thead>
<tr>
<th field="ck" checkbox="true"></th>
</tr>
</thead>
</table>
2.如何根据数据初始化选中
获取数据后手动设置选中,不然之后获取不到初始化选中项。
$('#table1').datagrid("selectRecord",dataArr[i].id);
3.如何获取选中项
var checkedItem = $('#table1').datagrid('getChecked');