PDA

View Full Version : Grouping view



c+cool
17 Oct 2011, 7:40 AM
Hello,

I'm using a simple Grid and I want to reconfigure it using a grouping store and a column models like this :


var colModels = new Ext.grid.ColumnModel({
columns: listColumnModels,
defaults: {
sortable:true,
menuDisabled:false
}
});
var taskReader = new Ext.data.JsonReader({
idProperty: 'hidden',
root: 'root',
totalProperty: 'results',
fields: listGrouping
});
var newStore = new Ext.data.GroupingStore({
sortInfo: {field: 'hidden', direction: 'ASC'},
reader: taskReader,
data: dataGrp,
groupField: grouping
});

grid.view = new Ext.grid.GroupingView({
forceFit:true,
groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
});
grid.view.init(grid);
grid.view.render();
grid.reconfigure(newStore, colModels);


But the display is not correct all is grouped in one !