Hybrid View

  1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    21
    Vote Rating
    0
    Bouki is on a distinguished road

      0  

    Default Air viewport and panel

    Air viewport and panel


    Hi
    I want to have a panel fitting my viewport.
    Previously I had :

    Code:
    var window = new Ext.air.Window({
        //...
        items:[panel]
    });
    Now I want to do this :

    Code:
    var window = new Ext.air.Window({
        //...
        items:[]
    });
    window.on('complete', function () {
        viewport = window.getViewport();
    }, this);
    //and later
        viewport.removeAll();
        viewport.add(panel);
    However the second code doesn't work : the panel has a limited height or 0 height (depending if it contains extjs components or html)

  2. #2
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    But the panel is added? Does your Ext.air.Window has a layout:'fit' config option? Or rather do a viewport.doLayout(); after adding the panel.
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Posts
    21
    Vote Rating
    0
    Bouki is on a distinguished road

      0  

    Default


    my panel is as follows :
    Code:
                panel = new Ext.Panel({
                    layout: 'fit',
                    region: 'center',
                    monitorResize: true,
                    border: false,
                    id: 'content'
                });
    also, adding viewport.doLayout(); after viewport.add(panel); does nothing

    I have to mention that if I set a fixed height (eg 500), it works (however the panel does'nt fit viewport)
    If the height is not set then the calculated height is 0 or nearly and the panel doesn't show its content

  4. #4
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    The viewport (Ext.air.Window) needs a layout:'fit' config option, not the Panel itself! The viewport is the container for the panel.
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

  5. #5
    Sencha User
    Join Date
    Dec 2010
    Posts
    21
    Vote Rating
    0
    Bouki is on a distinguished road

      0  

    Default


    Thanks for your solution

    I finally ended up with another issue
    My final panel ("test") doesn't show !

    Here is the code :
    Code:
                //at first
                window = new Ext.air.Window({
                    win: window.nativeWindow,
                    layout: 'fit',
                    closable: true,
                    trusted: true,
                    transparent: false,
                    systemChrome: 'none',
                    minWidth: 900,
                    minHeight: 500
                });
                window.on('complete', function(win) {
                    viewport = win.getViewport();
                }, this);
                //...
                //later
                container = new Ext.Panel({
                    border: false,
                    layout: 'fit'
                });
                panel = new Ext.Panel({
                    border: false,
                    region: 'center',
                    title: 'Accueil',
                    layout: 'border',
                    items: [],
                    id: 'content'
                });
                container.add({
                    xtype: 'container',
                    layout: {
                        type: 'vbox'
                    },
                    items: [toolbar1, toolbar2, panel]
                });
                window.setTitle('Bardeen application');
                window.setSize(980, 580);
                viewport.removeAll();
                viewport.add(this.container);
                viewport.doLayout();
                //the panel content will change depending on toolbar click
                //this is the first view when the user hasn't yet clicked
                test = new Ext.Panel({
                    padding: "5 5 5 5",
                    title: 'Test',
                    html: '123456'
                });
                panel.removeAll();
                panel.add(test);
                panel.doLayout();
    What is strange is that I can see "panel" but not "test" !
    I believe there is an issue with my "panel" config options

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi