Hi all! I have a strange problem with a class that extends Ext.data.JsonStore:
Code:
ENCFax.module.user.Store = Ext.extend( Ext.data.JsonStore, {
autoLoad: true,
root: 'rows',
idProperty: 'id',
fields: ENCFax.module.user.Record,
proxy: new Ext.data.HttpProxy( {
api: {
read: ENCFax.URL.USER.GET,
create: ENCFax.URL.USER.CREATE,
update: ENCFax.URL.USER.UPDATE,
destroy: ENCFax.URL.USER.DELETE
}
} )
} );
Ext.reg( 'encfax.user.store', ENCFax.module.user.Store );
Then I create a GridPanel inside a Window (also, another class that extends from Ext.grid.GridPanel):
Code:
w = new Ext.Window( {
id: windowID,
title: translations.USER.TITLE,
width: 700,
height: 350,
layout: 'fit',
autoScroll: true,
items: [ {
xtype: 'encfax.user.gridPanel',
id: 'encfax-user-grid',
iconCls: 'icon-user-group',
fbar: [ {
text: translations.USER.FORM.NEW.TITLE,
handler: this.showUserNewFormWindow.createDelegate( this ),
iconCls: 'icon-user-add'
} ],
store: {
xtype: 'encfax.user.store'
}
} ],
closeAction: 'hide'
} );
It does create the window with the grid panel, and even it fires the GET request to load the Store, but the store is empty even after the load. The strangest part is that if I don't use my own JsonStore class and I pass a config object to the store option with the xtype "jsonstore" with exactly the same config that my own JsonStore class.. it works:
Code:
w = new Ext.Window( {
id: windowID,
title: translations.USER.TITLE,
width: 700,
height: 350,
layout: 'fit',
autoScroll: true,
items: [ {
xtype: 'encfax.user.gridPanel',
id: 'encfax-user-grid',
iconCls: 'icon-user-group',
fbar: [ {
text: translations.USER.FORM.NEW.TITLE,
handler: this.showUserNewFormWindow.createDelegate( this ),
iconCls: 'icon-user-add'
} ],
store: {
// SAME configuration than my own JsonStore class!
xtype: 'jsonstore',
autoLoad: true,
root: 'rows',
idProperty: 'id',
fields: ENCFax.module.user.Record,
proxy: new Ext.data.HttpProxy( {
api: {
read: ENCFax.URL.USER.GET,
create: ENCFax.URL.USER.CREATE,
update: ENCFax.URL.USER.UPDATE,
destroy: ENCFax.URL.USER.DELETE
}
} )
}
} ],
closeAction: 'hide'
} );
What could be the problem here?
Thanks!