PDA

View Full Version : Ext.ux.grid.TableGrid and Ext.grid.GroupingView



p3p3
11 Feb 2010, 3:48 AM
Hi people,

i want to markup a table into gridpanel via "Ext.ux.grid.TableGrid". the new grid must use a grouping view. but the call of converting throw a exception:

this.grid.store.getGroupState is not a function
chrome://firebug/content/blank.gif return this.grid.store.getGroupState();


with this little code i markup it.


grid = new Ext.ux.grid.TableGrid("grid", {
stripeRows: true,
colModel: new Ext.grid.ColumnModel([
//new Ext.grid.RowNumberer(),
{header: 'Spalte 1', width: 200, dataIndex:'id', id:'id'},
{header: 'Spalte 2', width: 200, sortable: true, dataIndex:'wert',id:'wert'},
{header: 'Spalte 3', width: 200, sortable: true, dataIndex: 'nochwert',id:'nochwert'},
]),
bbar: new Ext.PagingToolbar({
pageSize: 10,
store: store,
displayInfo: true,
beforePageText: "Seite",
afterPageText: " von {0}",
displayMsg: 'Displaying topics {0} - {1} of {2} ',
emptyMsg: "No topics to display",

}),
view: groupgridView,
store: store,

});


where is the error? :((

p3p3

p3p3
12 Feb 2010, 6:01 AM
so i think its a bug. after any test i can't convert a html table into gridpanel with a grouping view. the datastore and the columnmodel are set right.

damn.....:((

Animal
12 Feb 2010, 7:00 AM
The Store needs to be a GroupingStore as you know from the docs.

p3p3
12 Feb 2010, 8:13 AM
i know, and the store is been set. but is NOT works.

p3p3

RedJane
14 May 2010, 4:35 AM
p3p3, I also needed a groupingview... Just take a look in tablegrid.js and you'll find it.

If not ;), the only thing I changed was:


var ds = new Ext.data.GroupingStore({
reader: new Ext.data.XmlReader({
record: 'tbody tr'
}, fields)
});

Ext.applyIf(this, {
'ds': ds,
'cm': cm,
view: new Ext.grid.GroupingView({
forceFit:true,
groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
}),
'sm': new Ext.grid.RowSelectionModel(),
autoHeight: true,
autoWidth: false
});