-
Sencha User
Answered: Locking Grid column menu
Is there a way to programmatically execute any of the items on the drop down menu for a column in a locking grid. I would like to lock and unlock or hide and unhide several columns based on a button in a tool bar on a locking grid. I am using ExtJS 4.0.7.
-
Best Answer Posted by
Animal
There are two grids.
But you can hide any column just by grabbing it using ComponentQuery.
And you can lock/unlock by using the lock/unlock method of the locking grid passing the column.
-
You could try something like: grid.column[1].hide() and grid.column[1].show()
-
Sencha User
I tried that early on, but that does not work. With locking grids, it's like there are two grids in the DOM. One is called lockedGrid and one normalGrid. Each has a view and columns. I tried using hide, show and setVisible(false) on these columns, but it does not function. I noticed that when you use the column menu it works fine, so that's why I wondered if I could access the menu and run those options from with in my Javascript.
-
There are two grids.
But you can hide any column just by grabbing it using ComponentQuery.
And you can lock/unlock by using the lock/unlock method of the locking grid passing the column.
-
Sencha User
If you have a grid, with nested columns, and it has locked columns, creating this scenario, when trying to hide/show columns, is it best to hide/show each of the sub columns or just the master column?
-
Sencha User
Sorry, I thought I had tried that and it had not worked, but I tried it again and it works fine. I did:
grid.down('#date5Column').hide();
where date5Column is the itemId for the column.
Locking and unlocking the the manual for 4.0.7, where I looked, appeared to be a private function and I wasn't sure if I should be using that.
Thanks for your help.
-
They are private, but they should be pretty stable. They are used by the lock and unlock menu items added when the grid is lockable. I can't see those methods ever going away.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules