-
3 Nov 2010 10:05 PM #1
Unanswered: Unable to extend Ext.data.JsonStore (proxy null)
Unanswered: Unable to extend Ext.data.JsonStore (proxy null)
Greetings,
I'm trying to extend JsonStore to create reusable component to access my rest service.
The following code works (no extend, in 'onReady'):
But when I do this, the store didn't work:Code:var store = Ext.data.JsonStore({ autoDestroy: true, url: '/decks', root: 'results', restful: true, idProperty: 'id', mode: 'local', fields: [{name: 'id', name: 'name'}] }); 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 ?Code: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(); });
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
-
3 Nov 2010 11:37 PM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
- Answers
- 1
A store isn't a component. It has no initComponent method!
For stores you will need to override the contructor instead.
-
4 Nov 2010 2:38 AM #3
AAAAH ! Shame on me ... really !
Totally forgot that not everything is Component in ExtJs ... bad Java 'Object' habit :-(
Thanks a lot, now that's rocks
Alois Cochard
http://aloiscochard.blogspot.com
http://www.twitter.com/aloiscochard
Similar Threads
-
[FIXED-1263] Ext.data.Proxy => Ext.data.DataProxy
By plalx in forum Ext 3.x: BugsReplies: 1Last Post: 13 Sep 2010, 4:18 PM -
Error this.proxy is null
By alkasoam in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 30 Mar 2010, 6:25 AM -
[2.0-rc1] Unable to extend TreePanel
By v_t_m in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 11 May 2009, 10:21 AM -
[2.0.2][CLOSED] data.JsonStore doesn't allow another proxy
By andrei.neculau in forum Ext 2.x: BugsReplies: 4Last Post: 27 Mar 2008, 11:32 AM


Reply With Quote