View Full Version : Dynamic grid grouping

11 Dec 2012, 12:58 AM

I have a combo box with some fields and want to select grouping field from it dynamically. When I select a field in combo box, it sends that data to grid's groupField property.

I have that combo box value selected in controller like,

var groupData = Ext.ComponentQuery.query('#groupid')[0].getValue();

I am sending it to grid like,

Ext.define('Group', {
singleton: true,
param: groupData

I am getting that for grid property (in another file) like,

groupField: [Group.param]

But this automatically selects first field for groupField property before even selecting anything in combo box and makes grouping, selecting other fields in combo box also doesn't work, it always has first field for grouping. What is going wrong? Please help.


12 Dec 2012, 1:48 AM
Any idea?

12 Dec 2012, 2:18 PM
Is the grid created already before the combo is selected?

13 Dec 2012, 1:11 AM
Yes, everything is dynamic though, I can have a grid before selecting combo (for grouping) or I can select combo as well, while creating grid. Grid is also dynamic :D.

14 Dec 2012, 3:37 AM
Any help is appreciated! :)

18 Dec 2012, 3:58 AM
How do you send/set the grouping of the grid. Grouping should be done via the store I think

have you tried?


18 Dec 2012, 4:15 AM

I am doing grouping in same dynamic grid (http://www.sencha.com/forum/showthread.php?242594-Dynamic-grid-with-dynamic-model) plugin only, I am doing like,

features: [{ftype:'grouping'}],
in View and in DynamicGrid.js I am setting property like,

groupField: [Group.param]

That parameter I am sending like I mentioned in my first post.