alois.cochard
3 Nov 2010, 10:05 PM
Greetings,
I'm trying to extend JsonStore to create reusable component to access my rest service.
The following code works (no extend, in 'onReady'):
var store = Ext.data.JsonStore({
autoDestroy: true,
url: '/decks',
root: 'results',
restful: true,
idProperty: 'id',
mode: 'local',
fields: [{name: 'id', name: 'name'}]
});
store.load();
But when I do this, the store didn't work:
Pomodeck.data.DeckStore = Ext.extend(Ext.data.JsonStore, {
initComponent: function() {
var config = {
autoDestroy: true,
url: '/decks',
root: 'results',
restful: true,
idProperty: 'id',
fields: [{name: 'id', name: 'name'}]
}
Ext.apply(this, Ext.apply(this.initialConfig, config));
Pomodeck.data.DeckStore.superclass.initComponent.apply(this, arguments);
}
});
Ext.onReady(function(){
Ext.QuickTips.init();
var store = new Pomodeck.data.DeckStore();
store.load();
});
After looking inside ext-all-debug.js when doing 'store.load()' the proxy variable is not defined. Seems that some initialization logic isn't processed when extending. Any idea ?
I never experienced such issues when extending other components.
I've tried different 'way' of extending but nothing change, help more than welcome !
Thanks
Alois Cochard
http://aloiscochard.blogspot.com
http://www.twitter.com/aloiscochard
I'm trying to extend JsonStore to create reusable component to access my rest service.
The following code works (no extend, in 'onReady'):
var store = Ext.data.JsonStore({
autoDestroy: true,
url: '/decks',
root: 'results',
restful: true,
idProperty: 'id',
mode: 'local',
fields: [{name: 'id', name: 'name'}]
});
store.load();
But when I do this, the store didn't work:
Pomodeck.data.DeckStore = Ext.extend(Ext.data.JsonStore, {
initComponent: function() {
var config = {
autoDestroy: true,
url: '/decks',
root: 'results',
restful: true,
idProperty: 'id',
fields: [{name: 'id', name: 'name'}]
}
Ext.apply(this, Ext.apply(this.initialConfig, config));
Pomodeck.data.DeckStore.superclass.initComponent.apply(this, arguments);
}
});
Ext.onReady(function(){
Ext.QuickTips.init();
var store = new Pomodeck.data.DeckStore();
store.load();
});
After looking inside ext-all-debug.js when doing 'store.load()' the proxy variable is not defined. Seems that some initialization logic isn't processed when extending. Any idea ?
I never experienced such issues when extending other components.
I've tried different 'way' of extending but nothing change, help more than welcome !
Thanks
Alois Cochard
http://aloiscochard.blogspot.com
http://www.twitter.com/aloiscochard