View Full Version : headerCt.getMenuItems() returns Null when a column is locked in a grid

27 Sep 2012, 2:07 AM
Hai i am using grid.headerCt.getMenuItems() to get the select column option inside a More Action Menu of a toolbar, but when ever i lock a column, i get the error grid.headerCt.getMenuItems() is null,

Please provide a solution

var cpPopUpGridPanel = Ext.create('Ext.grid.Panel',{ id:'cpPopUpGridPanel',
selModel: smPopUp,
columns: [

{ header: 'Sign Off', flex:3, id:'colorColumn', dataindex:'Sign Off', tdCls:'x-change-cell'},
{ header: 'ID', dataIndex: 'ID', flex:2, id:'id'},
{ header: 'Guideline Description', dataIndex: 'Guideline Desc', flex:6},
{ header: 'Fund', dataIndex: 'Fund', flex:2},
{ header: 'FIV', dataIndex: 'FIV', flex:2},
{ header: 'Source', dataIndex: 'Source', flex:2.5},
{ header: 'Owner', dataIndex: 'Owner', flex:2},
{ header: 'Alternate Owner', dataIndex: 'Alternate Owner', flex:2},
{ header: 'Attachment', dataIndex: 'Attachment', flex:1, hidden:true},
{ header: 'Frequency', dataIndex: 'Frequency', flex:1, hidden:true}]

var men=Ext.getCmp('cpPopUpGridPanel').headerCt.getMenuItems();
men[3].text="Select Columns";

Image of more Action, without locking a column:

27 Sep 2012, 2:21 AM
Lockable grid is in fact consisting of two grids: locked grid and normal grid. So, instead of access grid.headerCt with normal grid you should use grid.normalGrid.headerCt for normal grid and grid.lockedGrid.headerCt for locked grid.

27 Sep 2012, 9:21 PM
Thanks, working great....