ExtJS,在其他视图上调用Ext.window.window时出现问题

zlhcx6iw  于 2023-03-18  发布在  其他
关注(0)|答案(1)|浏览(119)

我已经定义了一个窗口类的宽度和高度与边框布局。它是工作时显示良好,但当我调用这个窗口类到其他视图,它是采取自己的大小,当布局类型是使用窗口将不会显示在所有。我是新的ExtJS和仍然搞清楚的事情
'这是我的窗口类Ext.define(' Task.view.a.a ',{

extend:'Ext.window.Window',
    title:'A- WINDOW',
    resizable:false,
    //autoShow:true,
    maxWidth:400,
    maxHeight:300,
    // layout:{
    //     type:'border'
    // },
    items:[{
        margin:'20 0 0 0',
        xtype:'panel',
        layout:'fit',
        title:'Panel in the Window',
        html:'Panel inside the window'
    }]
})`

'这是我在'任务.视图.main.Main'处理程序中的处理函数:function(btn){ var form = this.up(' form ').getForm();

if(form.isValid()){
                    //Ext.Msg.alert('Submitting!?','OKAY')
                    console.log(form.getValues())

                    Ext.defer(function(){
                        Ext.create('Task.view.a.a').show();
                    },2000)
                    
                }
                else{
                    Ext.Msg.alert('\'ERROR!?\' ','Please fill all the required fields')
                }
            }`
vfh0ocws

vfh0ocws1#

您可以使用

  • height/width而不是Windows配置中的maxHeight/maxWidth
  • 或定义子项的高度和宽度
  • 或如果要设置计算的窗口尺寸,请使用窗口显示列表器

更多示例请参考Kitchensink-https://examples.sencha.com/extjs/7.6.0/examples/kitchensink/#windows

Ext.define('MyWin', {
            extend: 'Ext.window.Window',
            title: 'A- WINDOW',
            resizable: false,
            maxWidth: 400,
            maxHeight: 300,
            items: [{
                xtype: 'panel',
                layout: 'fit',
                width: 400,
                height: 300,
                title: 'Panel in the Window',
                html: 'Panel inside the window'
            }]
        });

        Ext.defer(function () {
            Ext.create('MyWin').show();
        }, 2000);

相关问题