1.清空數據html
$('#dg').datagrid('loadData',{total:0,rows:[]});
$('#dg').datagrid({
columns:[[]],
rownumbers:false,
pagination:false
});
2.建立datagrid
var url = ctx + '/wisdom/classInfo/getClassInFo.html';$('#dg').datagrid({ url: url, width: "100%", height: "700px", striped: true, loadMsg: '正在加載班級的信息...', pagination: true, pageSize: 10, pageNumber: 1, pageList: [10, 20, 30], queryParams: {"accountId": accountId}, columns: [[ {field: 'ck', checkbox: true, align: 'left', width: 50}, {field: 'id', width: 100, hidden: true}, {field: 'gradeName', title: '年級名稱', width: 80}, {field: 'className', title: '班級名稱', width: 80}, ]]});