layui 数据表格隐藏列

var tableIns = table.render({
            elem: '#test'
                ,url:'<%=path%>/partyMember/getPartyMembersByOrgCode' 
                , width: '100%'
                , height: 480
                ,id:'PM_CODE'
            ,cols: [[ //标题栏
                {checkbox: true, LAY_CHECKED: false, filter:'test'}
                , {field: 'PM_CODE', title: 'PM_CODE', width: 180, align: 'center'} 
                , {field: 'HEAD_URL', title: '头像', width: 100, align: 'center',templet:'#imgTpl'}
                , {field: 'NAME', title: '党员姓名', width: 180, align: 'center'}
                , {field: 'ORG_NAME', title: '组织机构', width: 180, align: 'center'}
                , {field: 'MOBILE_NO', title: '手机号', width: 120, align: 'center'}
                , {field: 'SEX', title: '性别', width: 80, align: 'center',templet:'#sexTpl'}
            ]]
            , page: true //是否显示分页
            ,limits : [ 10, 20,50, 100 ],
            limit : 10
            ,done:function(res,curr,count){
                // 隐藏列
                $(".layui-table-box").find("[data-field='PM_CODE']").css("display","none");   
            }
          });

在done函数中设置该列的display为none。

猜你喜欢

转载自blog.csdn.net/huangbaokang/article/details/81983659