EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: A-K on August 18, 2014, 05:49:34 AM



Title: hide with column group
Post by: A-K on August 18, 2014, 05:49:34 AM
Hey, I have a datagrid with column group, this is the code for the columns:
Code:
columns: [[
            {
                field: 'listprice',
                title: 'Price',
                width: '15%',
                hidden: false,
                rowspan: 2
            },
            {
                title: "Status",
                halign: 'center',
                hidden: false,
                colspan: 2
            }
        ], [
            {
                field: 'itemid',
                title: 'Code',
                hidden: false,
                width: '10%'
            },
            {
                field: 'productid',
                title: 'Name',
                hidden: false,
                width: '10%'
            }
        ]]

Everything works great but in some cases I would need to hide some of my columns, and when I try to hide my group column (on start or later via custom code)
Code:
{
   title: "Status",
   halign: 'center',
   hidden: true,
   colspan: 2
}
I would expect it to hide the columns under him but it only hides itself like a regular column, This requires me to also
find the columns under him and to hide them too and when I have many group columns its not easy. Is it suppose to work like this or is it a known bug? because I cant see
anyone who would want to hide the top columns without hiding the columns under him.

Pictures below shows a datagrid when the column of the column group hidden is false, and when I try to hide the column group

Thanks, Alon.


Title: Re: hide with column group
Post by: stworthy on August 19, 2014, 12:16:16 AM
You will have to hide the group cell and its corresponding fields. Of course, you can write some code to initialize the column 'hidden' property and then pass it to the datagrid.