1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    6
    Vote Rating
    0
    sumith.paul is on a distinguished road

      0  

    Default Unanswered: Window rendering in a panel

    Unanswered: Window rendering in a panel


    I have been spending a couple of days trying to restrict a window rendered inside a panel .I used constrain:true param..But cant get it restricted completely within the panel.Yes..I can restrict it at top and both side ways,but not at bottom.Some kind of light would be of great help..Also how to define a drag/drop event handlers for window,other than the regular 'move' event.

  2. #2
    Sencha User
    Join Date
    Mar 2010
    Posts
    6
    Vote Rating
    0
    sumith.paul is on a distinguished road

      0  

    Default


    Here is the code I have had no luck with..
    Code:
    var viewport = Ext.create('Ext.container.Viewport', {
                        renderTo: Ext.getBody(),
                        layout: 'border',
                        items: [{
                            region: 'west',
                            width: 200,
                            collapsible: true,
                            collapsed: true,
                            html: 'West Region'
                        }, {
                            region: 'center'
                        }, {
                            region: 'east',
                            width: 200,
                            collapsible: true,
                            collapsed: true,
                            html: 'East Region'
                        }, {
                            region: 'south',
                            height: 50,
                            html: 'South Region'
                        }],
                        listeners:{
                            'afterrender':function(){
                                 var win = Ext.create('Ext.window.Window', {
                                    renderTo: this.layout.regions.center.getEl(), // using renderTo
                                    width: 400,
                                    height: 300,
                                    title: 'Test',
                                    constrain:true,
                                    constrainHeader: true
                                }).show;
    
                            }
                        }
                    });

  3. #3
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Answers
    124
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Quote Originally Posted by sumith.paul View Post
    Here is the code I have had no luck with..
    Code:
                                 var win = Ext.create('Ext.window.Window', {
                                    renderTo: this.layout.regions.center.getEl(), // using renderTo
                                    width: 400,
                                    height: 300,
                                    title: 'Test',
                                    constrain:true,
                                    constrainHeader: true
                                }).show;
    Are you missing this:-
    }).show();

    Also you may try draggable:false, by which window can not be dragged (moved).
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  4. #4
    Sencha User
    Join Date
    Mar 2010
    Posts
    6
    Vote Rating
    0
    sumith.paul is on a distinguished road

      0  

    Default


    Yes..i missed 'show()'..but that wont fix my problem..Also I need to drag it inside a panel.So cant keep draggable = false..

  5. #5
    Sencha User
    Join Date
    Mar 2010
    Posts
    6
    Vote Rating
    0
    sumith.paul is on a distinguished road

      0  

    Default fixed

    fixed


    Fixed it recently.
    Removing constrainHeader:true did the trick

  6. #6
    Sencha User
    Join Date
    Mar 2010
    Posts
    6
    Vote Rating
    0
    sumith.paul is on a distinguished road

      0  

    Default fixed

    fixed


    sorry..missed out one more thing

    constrain:true
    constrainTo: the div

    remove
    constrainHeader:true

Thread Participants: 1