View Full Version : How to Group by at a button's click event?

3 Nov 2010, 2:01 AM
Hi everyone,

Please help me in resolving the following two issues.

1. I have a UI with Ext.grid.GridPanel containing few columns. I want to prform a "group by this field" operation without using the "groupable:true" property. In other words I want to prform a "group by this field" in a button click event.

2. How to hide a column in a grig based on a property passed from the server (via Ext.data.JsonReader) ?

Best regards

3 Nov 2010, 2:19 AM
1. Call grid.getStore().groupBy('field', true, 'ASC')

2. Call grid.getColumnModel().setHidden(colIndex, true) from the store 'load' event (you can access the server data using store.reader.jsonData).

3 Nov 2010, 3:12 AM
Hi Condor,

Thanks a lot for your prompt reply. That really was helpful. Thanks again!!! :)

Best regards