PDA

View Full Version : gridSummary



chandan.behura
5 Aug 2012, 5:16 AM
Hi,
I have attached 1 screen shot. please go through that and give suggestion. I have taken local store
for data.So data side no issue.For testing i have taken some garbage data.
i have pasted my code also.

var summaryGrid = Ext.create('Ext.grid.Panel', {
height: 440,
width: 390,
store: store,
features: [{
ftype: 'groupingsummary',
groupHeaderTpl: '{name}'
}],
columns: [{
// text: 'Task',
height:0,
flex: 1,
// sortable: true,
dataIndex: 'program',
hideable: false

}]
});

37742

then one additional doubt how i can take that collapsible icon to right?

thanks ,
chandan.

castitas
6 Aug 2012, 8:53 AM
Have you looked at the docs for groupingsummary (http://docs.sencha.com/ext-js/4-1/#%21/api/Ext.grid.feature.GroupingSummary)?

Take a look at groupHeaderTpl (http://docs.sencha.com/ext-js/4-1/#%21/api/Ext.grid.feature.Grouping-cfg-groupHeaderTpl), startCollapsed (http://docs.sencha.com/ext-js/4-1/#%21/api/Ext.grid.feature.Grouping-cfg-startCollapsed), and showSummaryRow (http://docs.sencha.com/ext-js/4-1/#%21/api/Ext.grid.feature.AbstractSummary-cfg-showSummaryRow).

Are you wanting to total something? Your data doesn't suggest that... If not, use a grouping feature.

chandan.behura
6 Aug 2012, 8:30 PM
No there is nothing to total. see the screen shots.i just want to collapsible data and on click of groupHeader a panel should appear with some data and on click of items under that groupHeader a different panel should come with some other data.

so please suggest how to achieve that.

castitas
7 Aug 2012, 7:27 AM
It seems you want a grouping grid (http://docs.sencha.com/ext-js/4-1/#%21/api/Ext.grid.feature.Grouping). Here is an example (http://docs.sencha.com/ext-js/4-1/#%21/example/grid/groupgrid.html), and another (http://try.sencha.com/extjs/4.1.1/docs/Ext.grid.feature.Grouping.1/) one that you can edit.

Look at the groupclick event, and the cellclick on the grid.