murrah
25 Jul 2012, 5:32 PM
Hi,
I just wanted to post this in case someone else had the same problem. I am on the learning curve with ExtJS 4 and am setting up a test MVC app to learn.
My first attempt to connect a Store to a TreePanel resulted in the following error in Ext.tree.Panel:
me.store is undefined Line 191
What I had was my store:
Ext.define('AM.store.Tree', {
extend: 'Ext.data.TreeStore',
model: 'AM.model.Tree',
autoLoad: true,
alias : 'widget.usertreestore'
...
which I added to the tree like so:
store : 'usertreestore'
Using the debugger I found that the
me.store = Ext.StoreMgr.lookup(me.store); in Ext.tree.Panel.initComponent()
--> Ext.data.StoreManager.lookup()
--> Ext.uti.AbstractMixedCollection.get()
--> mk = me.map[key] where the key was, of course 'usertreestore'.
However, the map[] was expecting 'Tree'
So, changing the TreePanel config to
store :'Tree' solved the problem.
Now, my question is, it seems that in some places the xtype / alias can be used and in others (eg tree stores) it cant. Am I missing something, or is that intentional or is there a bug here?
Thanks,
Murray
I just wanted to post this in case someone else had the same problem. I am on the learning curve with ExtJS 4 and am setting up a test MVC app to learn.
My first attempt to connect a Store to a TreePanel resulted in the following error in Ext.tree.Panel:
me.store is undefined Line 191
What I had was my store:
Ext.define('AM.store.Tree', {
extend: 'Ext.data.TreeStore',
model: 'AM.model.Tree',
autoLoad: true,
alias : 'widget.usertreestore'
...
which I added to the tree like so:
store : 'usertreestore'
Using the debugger I found that the
me.store = Ext.StoreMgr.lookup(me.store); in Ext.tree.Panel.initComponent()
--> Ext.data.StoreManager.lookup()
--> Ext.uti.AbstractMixedCollection.get()
--> mk = me.map[key] where the key was, of course 'usertreestore'.
However, the map[] was expecting 'Tree'
So, changing the TreePanel config to
store :'Tree' solved the problem.
Now, my question is, it seems that in some places the xtype / alias can be used and in others (eg tree stores) it cant. Am I missing something, or is that intentional or is there a bug here?
Thanks,
Murray