PDA

View Full Version : Pass data from Proxy to Store



AndreKR
26 Mar 2011, 2:11 AM
Hi,

I am using a (grouping) Grid with a JsonLoader and a DirectProxy. Here's some example code:

xtype: 'grid',
store: {
xtype: 'groupingstore',
reader: new Ext.data.JsonReader({
root: 'data',
fields: [
{name: 'grouping_key'},
{name: 'attributes'},
],
}),

proxy: new Ext.data.DirectProxy({
directFn: item.get_attributes,
listeners: {
load: function (proxy, o)
{
proxy.number_of_groups = o.result.number_of_groups;
}
}
}),

groupField: 'grouping_key',
},
view: new Ext.grid.GroupingView({
groupTextTpl: 'Group {[values.rs[0].data.grouping_key]} of {[values.rs[0].store.proxy.number_of_groups]}',
}),
columns: [
{header: 'grouping_key', sortable: true, dataIndex: 'grouping_key', hideable: false, hidden: true},
{header: 'Attributes', sortable: true, dataIndex: 'attributes'},
],

Is that really the only way to access data that is sent with the Direct transaction?

Regards,
André