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

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

问题描述

我有一个包含一些组件(文本字段和按钮)的工具栏,我想在其他组件之前动态添加一个组件(例如文本字段).

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.

我尝试了 tbBar.add(myComponent); 没有成功.

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

有什么想法吗?

推荐答案

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

You can use Ext.container.AbstractContainer.insert:

tbBar.insert(0, myComponent);

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

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