$('#dg').datagrid({
url:"url",
method:'post',
singleSelect: false,
collapsible: true,
autoRowHeight: 35,
fitColumns: true,
pagination: true,
rownumbers: true,
rowStyler:function(index,row){
if(row.isFinanceExamine==1){
return 'background-color:#6293BB;color:#fff;font-weight:bold;';
}
},
onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
if (data.rows.length > 0) {
//循环判断操作为新增的不能选择
for (var i = 0; i < data.rows.length; i++) {
//根据isFinanceExamine让某些行不可选
if (data.rows[i].isFinanceExamine == 1) {
$("input[type='checkbox']")[i + 1].disabled = true;
}
}
}
},
onClickRow: function(rowIndex, rowData){
//加载完毕后获取所有的checkbox遍历
$("input[type='checkbox']").each(function(index, el){
//如果当前的复选框不可选,则不让其选中
if (el.disabled == true) {
$('#dg').datagrid('unselectRow', index - 1);
}
})
}
});
url:"url",
method:'post',
singleSelect: false,
collapsible: true,
autoRowHeight: 35,
fitColumns: true,
pagination: true,
rownumbers: true,
rowStyler:function(index,row){
if(row.isFinanceExamine==1){
return 'background-color:#6293BB;color:#fff;font-weight:bold;';
}
},
onLoadSuccess: function(data){//加载完毕后获取所有的checkbox遍历
if (data.rows.length > 0) {
//循环判断操作为新增的不能选择
for (var i = 0; i < data.rows.length; i++) {
//根据isFinanceExamine让某些行不可选
if (data.rows[i].isFinanceExamine == 1) {
$("input[type='checkbox']")[i + 1].disabled = true;
}
}
}
},
onClickRow: function(rowIndex, rowData){
//加载完毕后获取所有的checkbox遍历
$("input[type='checkbox']").each(function(index, el){
//如果当前的复选框不可选,则不让其选中
if (el.disabled == true) {
$('#dg').datagrid('unselectRow', index - 1);
}
})
}
});