Yes, you can still add multiple columns to a grouping grid, and it’s not that hard, you just have to look in the store!
To add a second or even third column to an extjs grid all you now have to is add the extra columns in the store’s getGroupString property. The code below illustrates the addition of a second value when the group string equals some_property.
var some_data_store = Ext.create('Ext.data.Store', {
storeId:'some_data_store',
groupField:'some_property',
getGroupString: function(instance) {
var group = this.groupers.first();
if (group) {
if (group.property == 'some_property') {
return instance.get(group.property) + ' (' + instance.get('my_second_property') + ') ';
}
return instance.get(group.property);
}
return '';
},
model:'some_data_model',
autoLoad:true,
proxy: {
type: 'ajax',
url : 'some_url.php',
reader: {
type: 'json',
root: 'data'
}
}
});
That doesn’t work
Please elaborate, what is the exact problem, it would help if you posted code and the version of extjs that you are using.
Works for me , but only one level grouping. I need multilevel groupping like here: http://jaffa.sourceforge.net/JaffaRIATests/tests/extjs/multigroup/MultiGroup.html
I need multilevel groupping like here: http://jaffa.sourceforge.net/JaffaRIATests/tests/extjs/multigroup/MultiGroup.html
Great post. Its working well as expected….