简体   繁体   中英

How to add the Ext.window.window modal positioned inside another grid panel in EXTJS

Modal window is added to the body by default. But,I want to add a modal window inside a panel when a add button click event. What code I have to add. Anyone suggest an idea.

Modal Window Code:

        self.sampleWindow = Ext.create("Ext.window.Window", {
        title: 'Add Deals',
        layout: 'vbox',
        closeAction: 'hide',
        padding: 10,
        cls: 'custom-modal',
        constrain:'true',
        height: (mq.matches)?"77%":"70%",
        width: (mq.matches)?"67%":"60%",
        margin:'31 0 0 -36',
        scrollable : true,
        items: [self.buildSample(),
               self.buildSampleGrid()],
        listeners:{
            hide:function(win){
                win.close();
            }
        }
    });

Panel Code:

var panel1 = Ext.create("Ext.panel.Panel",{
            id: 'dealInformationblock',
            minHeight:10,
            padding: 10,
            margin:(nq.matches)?'10 30 5 10':'10 10 5 0',
            cls: ['innerCard','card-layout-border'],
            layout:{
                type: 'vbox',
                align: 'center'
            },
            items:[
                SampleInformation
            ]
        })
        return panel1;

Above modal window should be placed positioned inside the panel1.

使用showAt( x, [y] )显示window.x和y应该是面板内的值。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM