Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/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.1中从应用程序的控制器调用视图_Extjs_Extjs4.1_Extjs4.2_Sencha Architect - Fatal编程技术网

如何在extjs4.1中从应用程序的控制器调用视图

如何在extjs4.1中从应用程序的控制器调用视图,extjs,extjs4.1,extjs4.2,sencha-architect,Extjs,Extjs4.1,Extjs4.2,Sencha Architect,有人能告诉我们如何在extjs4.1中从应用程序的控制器调用view吗 谢谢您可以使用组件查询或引用 组件查询将按itemid、id、xtype或其所在容器的继承权查找视图。请参阅文档。它的工作原理非常简单,例如,按id搜索如下: Ext.ComponentQuery.query('#myPanelId') 或者,您可以使用refs。它们使用与组件查询相同的查询语言,但在控制器上定义,因此您可以使用以下自动生成的方法命名和重用它们。getMyView()获取视图。检查文档并阅读控制器的简介文档,

有人能告诉我们如何在extjs4.1中从应用程序的控制器调用view吗


谢谢

您可以使用组件查询或引用

组件查询将按itemid、id、xtype或其所在容器的继承权查找视图。请参阅文档。它的工作原理非常简单,例如,按id搜索如下:
Ext.ComponentQuery.query('#myPanelId')

或者,您可以使用refs。它们使用与组件查询相同的查询语言,但在控制器上定义,因此您可以使用以下自动生成的方法命名和重用它们。getMyView()获取视图。检查文档并阅读控制器的简介文档,你就会明白其中的意思

Ext.define("MyApp.controller.Foo", {
    extend: "Ext.app.Controller",
    refs: [
        {
            ref: 'list',
            selector: 'grid'
        }
    ],
    myMethod: function () {
        //This is how you access your named ref!!!
        this.getList().getStore().sort();
    }
});

你是认真的吗?Sencha的网站上有大量的示例和文档。