Hybrid View

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

      0  

    Default Calling multiple windows

    Calling multiple windows


    Hi

    I'm looking for a way to construct windows with custom additionnal dom on load and possibilities to bind event (for a common toolbar)

    I tried to achieve this by extending the Ext.air.NativeWindow class and performing changes to the dom by method "onComplete"

    This successfully modify the dom... but not only on the main window (called initially via application.xml config)

    Here is my code :

    main.html
    HTML Code:
    <button onclick = "new Test.Window({file: 'test.html'});">New Window()</button><br />
    javascript
    Code:
    Ext.ns('Test');
    (function(){
        var Window = Ext.extend(Ext.air.NativeWindow, {
            closable: true,
            maximizable: true,
            minimizable: true,
            resizable: true,
            systemChrome: air.NativeWindowSystemChrome.NONE,
            transparent: true,
            width: 1024,
            height: 768,
           
            constructor: function(config){
                Ext.apply(this, config);
                Window.superclass.constructor.call(this);
                this.center();
                this.show();
            },
    
            onComplete: function () {
                    Ext.DomHelper.append(Ext.get('main').dom, {
                        tag: 'div',
                        html: '--- test ---'
                    });
            }
        });
        Test.Window = Window;
    })();

  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


    Hi Bouki,

    Quote Originally Posted by Bouki View Post
    This successfully modify the dom... but not only on the main window (called initially via application.xml config)
    Do you mean "but not only on the main window"? This is what I would expect after seeing your code.
    The "Ext" you're calling is the main window's Ext. You have to use:
    Code:
    onComplete: function () {
        var wExt = this.getWindow().Ext;
        wExt.DomHelper.append(wExt.get('main').dom, {
            tag: 'div',
            html: '--- test ---'
        });
        Window.superclass.onComplete.call(this); // don't forget it, it fires the complete event
    }
    or better:
    Code:
    onComplete: function () {
        var wExt = this.getWindow().Ext;
        wExt.fly('main').createChild({
            tag: 'div',
            html: '--- test ---'
        });
        Window.superclass.onComplete.call(this);
    }
    If you want to create toolbars, panels - ext components in general - think about Ext.air.Window!

    makana
    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


    thanks a lot, this is exactly what I was looking for

    and sorry for my mistake in the explaination

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

      0  

    Default


    I'm also looking for a way to transmit datas between my windows, by passing them to the constructor

    for instance I would like to do new Test.Window{variables: {a: 1, b: 2}}; and then be able to retrieve "a" and "b" from my page

    I tried to achieve this by appending to the head markup
    HTML Code:
    <script type="text/javascript">var datas = {a: 1, b: 2}</script>
    but this doesn't works because the page is already loaded

    is there a simple way to do that ?

  5. #5
    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


    Bouki,

    all Ext.air.NativeWindows (try to) register by default in the Ext.air.NativeWindowManager within the main window. You can use it to access all the windows via their ids. Then use the getWindow method to get access to the dom window object of the window.
    e.g.
    Code:
    myWindow.manager.get('idOfMyMainExtAirNativeWindowInstance').getWindow();
    // or
    Ext.air.App.getRootHtmlWindow().Ext.air.NativeWindowManager.get('myId').getWindow();
    As cou can see there's an easier way for the main window's dom window object.
    Code:
    Ext.air.App.getRootHtmlWindow();
    makana
    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

Similar Threads

  1. calling windows/dialogs made in an external JS file?
    By foxofinfinety in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 7 Sep 2010, 12:28 PM
  2. Multiple windows issue
    By edsarro in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 1 Apr 2010, 11:27 AM
  3. multiple windows and modal
    By mmasters in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 26 Aug 2009, 8:58 PM
  4. [Help!] Multiple Windows within layout
    By Leonhart in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 11 Jul 2008, 7:45 AM

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