日期:2014-05-16 浏览次数:20445 次
$('#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;
}