schuc
9 Oct 2012, 11:47 AM
Hi everybody!
Iam developing with Ext js 4 and quite a newbie.
I've build a MVC App and try to redesign and pull out as much as code as possible in structured classes.
My Problem:
I've created a class as followed:
Ext.define('ServiceRequest.view.FacilityTreePanel',{
extend: 'Ext.tree.Panel',
config:{
treePanelId: '',
treePanelTitle: '',
treeStore: ''
},
constructor: function(config){
this.initConfig(config);
return this;
},
title: this.treePanelTitle,
itemId: this.treePanelId,
iconCls: 'nav',
store: this.treeStore
})
As you see i've had an constructor in wich i want to set the title, itemId and store
of the TreePanel.
I'd like to create this class in a Ext.each loop a couple of times.
I've checked that the given parameters to the class constructor are never the same.
For the first time the class is created.
After the second loop i get an
Uncaught TypeError: Cannot read property 'added' of undefined.
It seems like that the constructor call is after the setting of title,itemID and store.
What am i doing wrong?
Thanks a lot for any suggestion.
cheers Thomas
Iam developing with Ext js 4 and quite a newbie.
I've build a MVC App and try to redesign and pull out as much as code as possible in structured classes.
My Problem:
I've created a class as followed:
Ext.define('ServiceRequest.view.FacilityTreePanel',{
extend: 'Ext.tree.Panel',
config:{
treePanelId: '',
treePanelTitle: '',
treeStore: ''
},
constructor: function(config){
this.initConfig(config);
return this;
},
title: this.treePanelTitle,
itemId: this.treePanelId,
iconCls: 'nav',
store: this.treeStore
})
As you see i've had an constructor in wich i want to set the title, itemId and store
of the TreePanel.
I'd like to create this class in a Ext.each loop a couple of times.
I've checked that the given parameters to the class constructor are never the same.
For the first time the class is created.
After the second loop i get an
Uncaught TypeError: Cannot read property 'added' of undefined.
It seems like that the constructor call is after the setting of title,itemID and store.
What am i doing wrong?
Thanks a lot for any suggestion.
cheers Thomas