PDA

View Full Version : Hide Column Based on Summary



lhandbhel
11 Feb 2010, 10:54 PM
Can you guyz help me with my project

I have a grid and has columns with 'sum' summaryType. I want my grid by default, all columns with zero summary is set to hidden. And there's a button on Toolbar that shows/hide those columns with zero summary.. Only with 'sum' summaryType is affected.


here's my screen shot..

18717
Thanks a lot....

lhandbhel
14 Feb 2010, 5:11 PM
can somebody help me with this? i'm just new to ExtJS and web developing.

Thanks a lot guyz..

bclinton
14 Feb 2010, 9:01 PM
What have you tried so far?

You want a toggle control to turn hiding on and off, so you are going to need to write a function. You could then control the default behavior of the grid by calling that function when the grid renders.


my_grid.on("render",function(grid) {
hideBlankSummaryColumns(true);
}


Then, to hide columns check out the setHidden method in Ext.gridColumnModel http://www.extjs.com/deploy/dev/docs/?class=Ext.grid.ColumnModel (http://www.extjs.com/forum/../deploy/dev/docs/?class=Ext.grid.ColumnModel)

lhandbhel
18 Feb 2010, 10:06 PM
What have you tried so far?

You want a toggle control to turn hiding on and off, so you are going to need to write a function. You could then control the default behavior of the grid by calling that function when the grid renders.


my_grid.on("render",function(grid) {
hideBlankSummaryColumns(true);
}Then, to hide columns check out the setHidden method in Ext.gridColumnModel http://www.extjs.com/deploy/dev/docs/?class=Ext.grid.ColumnModel (http://www.extjs.com/forum/../deploy/dev/docs/?class=Ext.grid.ColumnModel)


How can I check if the summary is zero? or how can I loop in every data in a particular column and get its value?

Anyways.. thanks a lot for that idea..