$('#DataGrid').datagrid('loadData', { total: 0, rows: [] }); $('#DataGrid').datagrid({ title: '', dataType: 'json', singleSelect: true, rownumbers: true, autoRowHeight: false, pagination: true, pageNumber: 1, pageList: [15, 20, 30], pageSize: 15, onLoadSuccess: function (data) { //判断某种情况下 $('#DataGrid').datagrid('hideColumn','列field');//隐藏某列 //某种情况下 $('#DataGrid').datagrid('showColumn','列field');//显示某列 } });