开发者

sencha touch:dynamically add/remove components to panels

i extended a panel containing

-Panel 
   -Toolbar with button

and i registered it as a xtype using Ext.reg().There is one more panel in which i want to add the registered xtype and did it. How can i add/remove a component/html content dynamically to the outer panel on button click.

Thanks in a开发者_JAVA百科dvance.


I hope it will help you :

var component = ...;
var position = 0;
component.insert(position, new Ext.Panel({html : "inserted"}));
component.doComponentLayout();


While an older question, you can use .add or .addDocked

http://docs.sencha.com/touch/1-1/#!/api/Ext.Panel-method-add

This is far simpler since it allows the panel to add the element and manage the height ect.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜