-
7 Nov 2012 5:18 PM #1
Answered: Adding Ext.grid.feature.Grouping to grid breaks expand/collapse
Answered: Adding Ext.grid.feature.Grouping to grid breaks expand/collapse
Hey all,
I'm messing with the grid grouping features so I can change the groupHeaderTpls for my groups. I got the headers to look how I want but now the expanding/collapsing isn't working. Is there a workaroud for this?
Here is my Grid.js code, the commented features line is from my old version, this does allow expanding/collapsing.
I declare a groupField in my store fileCode:Ext.define('BZ.view.blaze.Grid', { extend: 'Ext.grid.Panel', alias: 'widget.blazegrid', store: 'Blaze', autoScroll: 'true', //features:[{groupingFeature}], features: [Ext.create('Ext.grid.feature.Grouping', { groupHeaderTpl: '{name} ({rows.length})', collapsible: true, }) ], initComponent: function(){ var dateRender = Ext.util.Format.dateRenderer('m/d/Y'); this.columns=[ {header: 'Subject', dataIndex: 'subject', width:175}, {header: 'Sender', dataIndex: 'sender', width:75}, {header: 'Attachment', dataIndex: 'attachment', width:40, renderer: function(value){ if(value=='') return ''; else return '<img src="ext/resources/themes/images/default/grid/accept.png" />'; } } ]; this.callParent(arguments); } });
Code:Ext.define('BZ.store.Blaze', { extend: 'Ext.data.Store', model: 'BZ.model.Blaze', data: [ //hardcoded data ], groupField: 'course', sortOnLoad: true, sorters: [{ property: 'date', direction: 'DESC' }] });
-
Best Answer Posted by mitchellsimoens
You should not do this:
Should really be like:Code:features: [Ext.create('Ext.grid.feature.Grouping', { groupHeaderTpl: '{name} ({rows.length})', collapsible: true, }) ],
Code:features: [ { ftype : 'grouping', groupHeaderTpl: '{name} ({rows.length})', collapsible: true, } ],
-
9 Nov 2012 9:32 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
- Answers
- 3101
You should not do this:
Should really be like:Code:features: [Ext.create('Ext.grid.feature.Grouping', { groupHeaderTpl: '{name} ({rows.length})', collapsible: true, }) ],
Code:features: [ { ftype : 'grouping', groupHeaderTpl: '{name} ({rows.length})', collapsible: true, } ],Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
9 Nov 2012 10:47 AM #3


Reply With Quote