EasyUI Forum
May 09, 2024, 11:15:15 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: hide with column group  (Read 6435 times)
A-K
Full Member
***
Posts: 122


View Profile WWW
« 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.
« Last Edit: August 18, 2014, 05:51:48 AM by AlonKatz » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!