Hi all,
In my page,there have one datagrid component,the first column is checkbox.
When the data load,only two data checked value are true,all the others are false,but the datagrid display each row is selected.
Please help me.
Thank you.
<table id="gridmaster"></table>
<script>
$(function () {
$('#gridmaster').datagrid({
title: '',
url: '/Box/Company/GetJsonFunctionGrid',
method: 'get',
width: '700',
rownumbers: true,
columns: [[
{ field: 'ck', checkbox: true },
{ field: 'sysfunnumber', title: 'sysfunnumber' }
]],
queryParams: {
id: id,
},
singleSelect: false,
selectOnCheck: true,
checkOnSelect: true,
onLoadSuccess: function (data) {
if (data) {
$.each(data.rows, function (index, item) {
if (item.checked) {
$('#gridmaster').datagrid('checkRow', index);
}
});
}
}
});
});
</script>