开发者

sencha touch:dynamically add/remove components to panels

开发者 https://www.devze.com 2023-04-08 21:17 出处:网络
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 a

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

精彩评论

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

关注公众号