sencha touch - How do I dynamically add a new Panel to a Ext.tab.Panel? -


i'd dynamically add new panel or container ext.tab.panel. tried code this:

var panel = ext.create('ext.container'); panel.title = 'from code'; panel.iconcls = 'home'; panel.stylehtmlcontent = true; panel.html = 'hello code';  tabpanel.add(panel); 

but gives me error:

adding card tab container without specifying tab configuration 

i can add new panel or container using object literal style, how do when construct new object hand? ext.container class doesn't have title property itself.

thanks!

you need specify iconcls , title configuration in panel or container when adding tabpanel

you did but, think problem way creating container , setting iconcls, title configuration.

  var panel = ext.create('ext.container', {        title: 'from code',         iconcls: 'home',         html : 'hello code'   });     var tab = ext.create('ext.tabpanel', {     fullscreen: true,     tabbarposition: 'bottom',      defaults: {         stylehtmlcontent: true     },      items: [         {             title: 'home',             iconcls: 'home',             html: 'home screen'         },         {             title: 'contact',             iconcls: 'user',             html: 'contact screen'         }     ] });   tab.add(panel); 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -