PDA

View Full Version : Extension for hidding/showing several columns at once



Thomas Triplet
6 Jul 2009, 12:42 PM
Hi,
I'm working with EditorGrids, and I'd like to be able to add a button (or something) in the context menu of the column headers such that I can hide/show a set of columns in one click. I remember I saw one extension to do that, but I can't remember the name and I can't find it anymore :((

Any clue?

Thanks

jay@moduscreate.com
7 Jul 2009, 5:12 AM
I wrote this override a long time ago:

http://tdg-i.com/22/gridview-override-adding-showall-button-and-columnviews-filter-sets

http://tdg-i.com/img/screencasts/2008-03-03_1548.png
http://tdg-i.com/img/screencasts/2008-03-03_1549.png

Condor
7 Jul 2009, 5:18 AM
You can also use:

grid.getColumnModel().setConfig(newConfig);
(new config would contain only the visible columns or all columns with some hidden)

Thomas Triplet
7 Jul 2009, 7:49 AM
I wrote this override a long time ago:

http://tdg-i.com/22/gridview-override-adding-showall-button-and-columnviews-filter-sets

...

Thanks a lot, that was exactly what I had in mind, but I couldn't find it anymore :-?

jay@moduscreate.com
7 Jul 2009, 7:52 AM
You can also use:

grid.getColumnModel().setConfig(newConfig);
(new config would contain only the visible columns or all columns with some hidden)

That's a very clean way of achieving that goal, but the menu still needs to appear. I will have to rework this to include what you suggested.

Thanks :)