PDA

View Full Version : Ext.direct and grouping grid



maren
24 Jul 2009, 2:59 AM
Hi,
I need to find a method to create a grouping grid with Ext.data.directstore
In a simple store we can use Ext.data.GroupingStore but in direct i doesn't found a method
Can someone give me an advice please
thanks

Condor
24 Jul 2009, 3:03 AM
A DirectStore is a normal Store with a preconfigured DirectProxy and a JsonReader.

If you want to use a GroupingStore, you'll have to specify the proxy and reader yourself.

maren
24 Jul 2009, 3:35 AM
this code is to create a store for simple data grid with Ext.direct


var experienceStore = new Ext.data.DirectStore( {
paramsAsHash:false,
root:'',
directFn: DirectStoreDemo.loadExperienceData,
idProperty:'description',
fields: [
{name: 'id' },
{name: 'name'},
{name: 'value'},
{name: 'description'}
],

listeners: {
load: function(s, records){
Ext.MessageBox.alert( "Information", "Loaded " + records.length + " records");
}
}
});

but I need to do the same thing with a grouping grid.:-/
GroupingStore doesn't have an option "directFn" like DirectStore

Condor
24 Jul 2009, 3:48 AM
I really thought my previous message was clear enough:

var experienceStore = new Ext.data.GroupingStore({
proxy: new Ext.data.DirectProxy({
paramsAsHash: false,
directFn: DirectStoreDemo.loadExperienceData
}),
reader: new Ext.data.JsonReader({
root:'',
idProperty:'description',
fields: [
{name: 'id'},
{name: 'name'},
{name: 'value'},
{name: 'description'}
]
}),
listeners: {
load: function(s, records){
Ext.MessageBox.alert("Information", "Loaded " + records.length + " records");
}
}
});