语法:$('#grid').datagrid('hideColumn','列field');
eg:
<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');
}
})
本文介绍如何使用EasyUI的Datagrid组件通过JavaScript隐藏表格中的指定列。通过提供具体的示例代码,展示如何在加载成功回调函数中隐藏体重列。
165

被折叠的 条评论
为什么被折叠?



