先创建一个数据表格
// 初始化数据表格
$('#excel').datagrid({
columns : columns,
// url : '/nursing/queryExcel',
url : '/nursing/queryExcel',
method : 'GET',
rownumbers : true,// 行号
autoRowHeight : false,
pagination : true,// 分页条
fitColumns : true,// 自动使列适应表格宽度
checkOnSelect : false,
selectOnCheck : true,
toolbar : '#tb', // 自定义的工具栏操作按钮
pageSize : 5,
pageList : [ 5, 10, 15, 20 ],
frozenColumns : [[{ field : 'ns_name', title : '养老院名称', width : 150, align :
'center' }, { field : 'devices_name', title : '设备名称', width : 150, align :
'center' }]],
onLoadSuccess : function(data) {
if (data.rows.length > 0) {
// 调用mergeCellsByField()合并单元格
mergeCellsByField("excel", "ns_name,devices_name");
}
}
}) // 初始化数据表格
$('#excel').datagri