如何在特定位置添加ExtJs组件(索引)? [英] How to add an ExtJs component at a specific position (index)?

查看:133
本文介绍了如何在特定位置添加ExtJs组件(索引)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ToolBar与一些组件(TextFields和Buttons),我想在其他组件之前动态添加一个组件(例如TextField)。



我试过 tbBar.add(myComponent); 没有成功。



任何想法?

解决方案

您可以使用 Ext.container.AbstractContainer.insert

  tbBar.insert(0,myComponent); 


I have a ToolBar with some components (TextFields and Buttons) and I would like to dynamically add a component (TextField, for example) before the other components.

I tried tbBar.add(myComponent); without success.

Any idea?

解决方案

You can use Ext.container.AbstractContainer.insert:

tbBar.insert(0, myComponent);

这篇关于如何在特定位置添加ExtJs组件(索引)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆