New to senchatouch world, trying to make the following code work.
I have the following code :
myApp.views.Homecard = Ext.extend(Ext.TabPanel, {
id: 'myownid',
title : "home",
iconCls : "home",
defaults : {
styleHtmlContent : true
},
items : [{
title : 'Item1',
scroll : 'vertical',
iconCls : 'home',
html : 'Some Content'
}, {
title : 'Item2',
scroll : false,
iconCls : 'home',
html : 'Some Content'
}],
});
Ext.reg('homecard', myApp.views.Homecard);
And i'd like to add a new item :
myApp.views.Homec开发者_C百科ard.add({html: 'test'});
But i'm getting the following error :
Uncaught TypeError: Object function (){h.apply(this,arguments)}
has no method 'add'
What am I missing ?
You can't access the TabPanel like that. Either add an id property and then get it with Ext.getCmp(theId);
or get it like item of it's parent, example parent.items.items[0];
精彩评论