语法:$("#grid").datagrid(“hideColumn”,“列field”);
table举例如下:
<table id="testDatagrid">
<thead>
<tr>
<th data-options="field:'name',width:80,align:'center'">姓名</th>
<th data-options="field:'age',width:80,align:'center'">年龄</th>
<th data-options="field:'idCard',width:150,align:'center'">身份证号码</th>
<th data-options="field:'weight',width:80,align:'center'">体重</th>
</tr>
</thead>
</table>
使用方式如下:
$("#testDatagrid").datagrid({
rownumbers:true,
border:false,
sortOrder:'desc',
url:'',
onLoadSuccess: function () {
$("#testDatagrid").datagrid('hideColumn', 'weight');
}
})