1. #1
    Sencha Premium Member
    Join Date
    Aug 2011
    Posts
    37
    Vote Rating
    0
    zehavibarak is on a distinguished road

      0  

    Default Unanswered: Add floating panel to viewport

    Unanswered: Add floating panel to viewport


    Hi,
    I'm trying to add a floating panel to viewport (using insert()); I wish to have the panel "lose" it's floating behavior;
    This worked with 2.0.1 and now it doesn't (2.1.0)
    The other way around (fixed to floating) - does work;
    Please advise,

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,107
    Vote Rating
    453
    Answers
    3157
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    You need to make it non floating:

    Code:
    var panel = new Ext.Panel({
        centered : true,
        width    : 200,
        height   : 200,
        html     : 'Test'
    });
    
    Ext.Viewport.add({
        items : [
            {
                xtype   : 'button',
                text    : 'Insert',
                handler : function(button) {
                    var cnt = button.up('container');
    
                    panel.setCentered(false);
    
                    cnt.add(panel);
                }
            }
        ]
    });
    
    Ext.Viewport.add(panel);
    
    panel.show();
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Aug 2011
    Posts
    37
    Vote Rating
    0
    zehavibarak is on a distinguished road

      0  

    Default


    More like

    var panel = new Ext.Panel({ width : 200, height : 200, html : 'Test'});
    Ext.Viewport.add({ items : [ { xtype : 'button', text : 'Insert', handler : function(button) { panel.showBy(this);
    }}, { xtype : 'button', text : 'Insert1', handler : function(button) {
    Viewport.insert(0, panel); } } ]});

    Please advise

  4. #4
    Sencha Premium Member
    Join Date
    Aug 2011
    Posts
    37
    Vote Rating
    0
    zehavibarak is on a distinguished road

      0  

    Default


    Still not working