$(function() {
grid = $('#grid').datagrid({
title : '',
url : gx.contextPath + '/base/base-infor!queryBaseInfor.seryo',
striped : true,
rownumbers : true,
pagination : true,
singleSelect : false,
idField : 'id',
sortName : 'crTime',
sortOrder : 'desc',
pageSize : 50,
pageList : [ 10, 20, 30, 40, 50, 100, 200, 300, 400, 500 ],
fitColumns : false, onClickRow : function(rowIndex, rowData){$("#grid").datagrid('clearSelections'); $('#grid').datagrid("selectRow", rowIndex); },
frozenColumns : [ [{checkbox: true},{
width : '100',
title : '证号',
field : 'baseCardid',
sortable : true,
hidden : false,
formatter:function(value,row,index){
if(row.isBuyBeyond==1){
return '<span style="color:red">'+value+'</span>';
}
return value;
}
}] ],
columns : [ [{
width : '220',
title : '所属区域',
field : 'disCities',
sortable : true,
hidden : false
}, {
width : '100',
title : '地址',
field : 'detailsAdress',
sortable : true,
hidden : false
}, {
width : '100',
title : '联系人',
field : 'contactPeople',
sortable : true,
hidden : false
}, {
width : '100',
title : '联系电话',
field : 'contactPhoneSDAS',
sortable : true,
hidden : false
}, {
width : '150',
title : '创建时间',
field : 'crTime',
hidden : false,
sortable : true
}, {
width : '150',
title : '修改时间',
hidden : false,
field : 'upTime',
sortable : true
} ] ],
toolbar : '#toolbar',
/* onBeforeLoad : function(param) {
$.messager.progress({
text : '数据加载中....'
});
}, */
onLoadSuccess : function(data) {
$('.iconImg').attr('src', gx.pixel_0);
$('#grid').datagrid('fixRownumber');
datagrid_clearSelections(grid);
//$.messager.progress('close');
}
});
});
得到效果,选框可以多选 ,选行只能单选