jquery easy ui datagrid checkbox设置符合条件的不可选,跪求大神帮忙
$('#dg').datagrid({
url:'datagrid_data.json',
columns:[[
{field:'code',checkbox:true,title:'Code',width:100},
{field:'name',title:'Name',width:100},
{field:'price',title:'Price',width:100,align:'right'}
]]
});
onSelect:function(rowIndex, rowData){
//如果该行不能被选中,则调用取消选中方法
if(CanNotCheck(rowData)){
setTimeout(function(){
$('#dg').datagrid('unselectRow',rowIndex);
},0);
}
},
function CanNotCheck(r){
if(r.xxx==???)
return true;
return false;
}$('#dg').datagrid({
url:'datagrid_data.json',
columns:[[
{field:'code',checkbox:true,title:'Code',width:100},
{field:'name',title:'Name',width:100},
{field:'price',title:'Price',width:100,align:'right'}
]],
???onSelect:function(rowIndex,?rowData){
????//如果该行不能被选中,则调用取消选中方法
?????if(CanNotCheck(rowData)){
????setTimeout(function(){
????????????$('#dg').datagrid('unselectRow',rowIndex);
????????},0);
????????}
????}
});
?
function?CanNotCheck(r){
if(r.xxx==???)
return?true;
return?false;
}