View Full Version : Grid Panel Column header menu

23 Mar 2014, 5:35 AM
I have CheckboxSelectionModel gridpanel, i need to stop hiding the column when i deselect from the header menu.

screenshots for reference:


i am able to deselect all the column from the columns menu.how can i restrict it to at least show one column as it happens if i dont use any selection model.

24 Mar 2014, 5:13 AM
The easiest way would probably be to add "hideable: false" onto at least one column in your grid.

Alternatively I'm sure you could listen to the columnModel's hiddenchange event, and simply return false if the number of visible columns is one:

http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.grid.ColumnModel-event-hiddenchange (http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.grid.ColumnModel-event-hiddenchange)

24 Mar 2014, 9:00 AM
thanks for the reply i tried as u suggested it worked
i add this listener for column model

listeners : {
hiddenchange : function(colModel, colIndex, hidden) {
if (colModel.getColumnCount(true) == 1) {
return false;