简体   繁体   English

EXTJS在Ext.window.Window中显示视图

[英]EXTJS Display a View within Ext.window.Window

I am using version 4.2. 我正在使用4.2版。

I currently have a view which extends a panel. 我目前有一个扩展面板的视图。 On this panel there is a button which displays a modal window. 在此面板上,有一个显示模式窗口的按钮。 The controller code when the button is clicked is below (which I pulled from the extjs docs ): 单击按钮时的控制器代码如下(我从extjs docs提取的代码):

displaySearch : function(btn) {
    var panel = Ext.create('Ext.window.Window', {
                    title: 'Hello',
                    height: 200,
                    width: 400,
                    layout: 'fit',
                    modal : true,
                    items: {  
                       ...
                    }
                }).show();
}

I want a View I already have created to be rendered INSIDE the modal window I just defined. 我希望在我刚刚定义的模态窗口内渲染已经创建的视图。

How do I do that? 我怎么做?

If you have defined an alias (xtype) for that view, let's say it is 'myview', then you just add it to items like this: 如果您已经为该视图定义了别名(xtype),那么说它是“ myview”,那么只需将其添加到以下项目中:

var panel = Ext.create('Ext.window.Window', {
    title: 'Hello',
    height: 200,
    width: 400,
    autoShow:true,
    layout: 'fit',
    modal : true,
    items: [{
        xtype:'myview'
    }]
});

Also, you don't need to call show() on the created window, it is enough if you configure autoShow:true . 另外,您无需在创建的窗口上调用show() ,如果您配置了autoShow:true ,就足够了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Extjs通过单击一个按钮来打开新的Ext.window.Window - Extjs opening new Ext.window.Window by clicking a button ExtJS中的控制器职责是什么? Ext.window.Window实例中的事件? - What is the controller responsibility in ExtJS? Events in instance of Ext.window.Window? 在 Ext.window.Window 中显示图像? - Show an image inside an Ext.window.Window? ExtJs 4-当可关闭属性进行动态更新时,如何更新Ext.window.Window布局? - ExtJs 4 - How to update Ext.window.Window layout when closable property was updated dinamically? 如何在EXTJS中的另一个网格面板中添加Ext.window.window模式 - How to add the Ext.window.window modal positioned inside another grid panel in EXTJS Ext6 / Sencha构建错误与Ext.window.Window - Ext6 /Sencha Build Error with Ext.window.Window 在提供的Ext.window.Window中设置禁止编辑该字段的权限 - Set the prohibition on editing the field in Ext.window.Window provided 如何将数据从json放入ext窗口中的extjs网格视图 - How to put data from json to extjs grid view in ext window 使用`Ext.window.Window`类实例后如何释放内存? - How free memory after using `Ext.window.Window` class instance? 将带有按钮的窗体面板添加到Ext.window.Window时,按钮不显示 - Buttons not showing up when adding a Form Panel with buttons to an Ext.window.Window
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM