Hide column not working in ExtJs GridColumn

1.2k Views Asked by At

In extjs I have a GridPanel.

I want to hide some of the columns of this gridpanel, I am using Hidden="true" for this and it is working fine.

The problem is, when I click on the Grid menu, there is an option called 'Columns'. When you mouseover 'Columns' you can check/uncheck the columns you want to show/hide.

I want to display the hidden columns in this list(unchecked) so that user can check them and manually display it on the grid.

I tried setting Hideable="true" but still these columns are not displying in the 'Columns' list.

Please suggest a solution

1

There are 1 best solutions below

0
On

The configuration option is hidden:true (lowercase), for example:

            ,columns:[{
                 text:'Company'
                ,dataIndex:'company'
                ,flex:10
            },{
                 text:'Price'
                ,xtype:'numbercolumn'
                ,dataIndex:'price'
                ,align:'right'
                ,width:80
            },{
                 text:'Last Updated'
                ,xtype:'datecolumn'
                ,dataIndex:'lastChange'
                ,align:'right'
                ,width:135
                ,hidden:true
            },{
                 text:'Industry'
                ,dataIndex:'industry'
                ,flex:4
            }] // eo columns

In this case, column Last Updated is initially hidden, but still appears in the column menu. If you still have troubles, make a showcase at https://fiddle.sencha.com