grid=$('#listTable').datagrid({
nowrap: false, 数据是否换行
striped: true, //数据是否显示条纹(偶数显示有条纹,奇数不显示条纹)
fit: false, //
url:'AZ04!showList.do',
sortName: 'fbm',
sortOrder: 'asc',
idField:'uuid', // 标记uuid为主键字段(uuid代表表主键字段名称)
frozenColumns:[[
{title:'选择',field:'ck',checkbox:true},
{title:'登录代码',field:'fbm',width:80,sortable:true},
{title:'用户名称',field:'fmc',width:80},
{field:'fsfqy',title:'是否启用',width:100,align:'center',
formatter:function(value,rec){
return value=='1'?"√":"×" ;
}}
]],
columns:[[
{title:'登录情况',colspan:2}
],[
{field:'fdlxtcs',title:'登录次数',width:150},
{field:'fscdlsj',title:'上次登录时间',width:150}
]],
pagination:true,
rownumbers:true,
pageSize:10, //每页显示记录数
pageList:[15,20,30], //可调整每页显示的记录数
singleSelect: false, 是否支持多选
queryParams:{firstQuery:true}
});
获取选中行的主键uuid如
var row = grid.datagrid('getSelected');
alert(row.uuid)