您的位置:首页 > 产品设计 > UI/UE

easyui datagrid checkbox单选时表头的checkbox不起作用,将其隐藏

2015-07-08 10:23 435 查看
在easyui datagrid开发的过程中,某列是checkbox的,但是当单选时这个表头的框不起作用,将其隐藏。在网上找到的方法。

 function InitGrid() {

        $('#tg').treegrid({

            idField: 'id',

            treeField: 'descript',

            pagination: false,

            singleSelect: true,

            height: 360,

            title: "我的列表",

            columns: [[

            { field: 'ck', width: 50, checkbox: true },

   { field: 'id', title: '编号', width: 50, align: 'center' },

            { field: 'descript', title: '名称', width: 120 }

    ]],

            onLoadSuccess: function () {

                $("#tg").parent().find("div .datagrid-header-check").children("input[type=\"checkbox\"]").eq(0).attr("style", "display:none;");

            }

        });

    }

关键是在初始化时加上

onLoadSuccess: function () {

                $("#tg").parent().find("div .datagrid-header-check").children("input[type=\"checkbox\"]").eq(0).attr("style", "display:none;");

            }

这样就可以把表头的checkbox隐藏了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: