Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs4 如何获取某一类型的所有X类型_Extjs4 - Fatal编程技术网

Extjs4 如何获取某一类型的所有X类型

Extjs4 如何获取某一类型的所有X类型,extjs4,Extjs4,我有一个小组,其项目如下: { xtype: "panel", border: 0, defaultType: "textfield", bodyStyle: "background: transparent;", defaults: {

我有一个小组,其项目如下:

                {
                    xtype: "panel",
                    border: 0,
                    defaultType: "textfield",
                    bodyStyle: "background: transparent;",
                    defaults: {
                        anchor: "100%",
                        flex: 1
                    },
                    margin: "2 4px",
                    layout: "hbox",
                    flex: 2,
                    items: [
                        {xtype: "searchvaluefield"}, {xtype: "random" }, {xtype: "searchvaluefield"}
                    ],

                }
但是,这些项目由动态数量的元素组成。特别是可以有任意数量的xtype“searchvaluefield”。我希望得到这个面板中所有元素的数组,这些元素都是xtype“searchvaluefield”。注意,我已经简化了问题,实际问题包含多个面板,这就是为什么我希望避免循环

如果有帮助的话,这里是我正在寻找的已定义的xtype:

    Ext.define("app.view.stock.SearchValueField", {
        extend: "Ext.form.field.Text",
        alias: "widget.searchvaluefield",
        name: "search_value_field",
        enableKeyEvents: true,
        allowBlank: false,
        initComponent: function() {
            this.callParent(arguments);
        }
    });
您可以使用面板的方法来完成此操作


yourPanel.query('searchvaluefield')-返回与该xtype匹配的项目数组。

答案简短但很棒!!