how to fix window in it's absolute position an

2019-09-09 19:30发布

问题:

In ExtJS when I scroll browser window Ext.window.window stays on same position on Viewport. I would like to fix this window on it's absolute position.
I saw documentation says:

fixed : Boolean Configure as true to have this Component fixed at its X, Y coordinates in the browser viewport, immune to scrolling the document.

Defaults to: false

But does not work for me. What I am missing? How to fix window in it's absolute position and don't scroll on browser scroll?

回答1:

This part works. But still, are you concerned about constrain?

 handler: function(button){
                                var w = Ext.create('Ext.window.Window', {
                                    height: 150,
                                    width: 200,                                        
                                    renderTo: button.up('fieldset').getEl().dom,
                                    title: 'child window'                                      
                                });

                                this.up('fieldset').add(w);
                                w.show();
                            }


回答2:

Like this maybe:

handler: function(){
    var w = Ext.create('Ext.window.Window', {
        height: 150,
        width: 200,
        title: 'child window',
    });

    this.up('fieldset').add(w);
    w.show();
}