Threaded View

  1. #1
    Sencha User
    Join Date
    Nov 2007
    Posts
    11
    Vote Rating
    0
    Answers
    1
    k.janiszewski is on a distinguished road

      0  

    Default Answered: Center window inside panel

    Answered: Center window inside panel


    Hi.

    I have problem with placing Ext.window inside Ext.panel. Window is not placed in center of panel, even when called center() method. When I maximize it, there is offset on the left side. Here is example:

    Code:
    <script type="text/javascript">
    
                Ext.onReady(function() {
                    var panelPulpitu = Ext.create('Ext.panel.Panel', {
                        region: 'center',
                        border: false
                    });
    
    
                    var menu = Ext.create('Ext.panel.Panel', {
                        region: 'west',
                        border: true,
                        width: 200,
                        items: [{
                            xtype: 'button',
                            text: 'Test button',
                            handler: function() {
                                okno = Ext.create('Ext.window.Window', {
                                    width: 500,
                                    height: 300,
                                    maximizable: true,
                                    constraint: true,
                                    renderTo: panelPulpitu.getEl()
                                });
                                okno.show();
                            }
                        }]
                    });
    
    
                    viewport = Ext.create('Ext.container.Viewport', {
                        layout: 'border',
                        border: false,
                        items: [menu, panelPulpitu]
                    });
                });
            </script>
    How should I configure Window/Panel to work correctly? I'm using Ext 4.1

    Best regards
    Krzychu

  2. Add the window to the panel

Thread Participants: 1

Tags for this Thread