1. #1
    Ext User mahendra_gayatri's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    58
    Vote Rating
    0
    mahendra_gayatri is on a distinguished road

      0  

    Question Desktop Multiple Windows

    Desktop Multiple Windows


    Hi,

    I was playing with the Desktop example.

    Is there anyway I can create multiple windows from the same desktop icon?

    Currently when I tried that, by commenting out the id part, It opened the window, but seems like they are all interlinked as changes on one reflect in the other.

    PLease help!!

  2. #2
    Ext User Slimsuperb's Avatar
    Join Date
    Nov 2008
    Location
    Nigeria
    Posts
    7
    Vote Rating
    0
    Slimsuperb is on a distinguished road

      0  

    Arrow Re: Desktop Multiple Windows

    Re: Desktop Multiple Windows


    yeah it's possible on how you want to structure your appliaction but you could start exploring here

  3. #3

  4. #4
    Ext User mahendra_gayatri's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    58
    Vote Rating
    0
    mahendra_gayatri is on a distinguished road

      0  

    Default


    sorry..

    Code:
    // Calling instance
    MyDesktop = new Ext.app.App({
        getModules: function(){
            return [ new MyDesktop.StateTreeWindow()];
        
    ...
    }})
    
    // Creating window
    MyDesktop.StateTreeWindow = Ext.extend(Ext.app.Module, {
        id: 'statetree-win',
        init: function(){
            this.launcher = {
                text: 'State Tree',
                iconCls: 'icon-statetree',
                handler: this.createWindow,
                scope: this
            }
        },
        
        createWindow: stateTreeWindow
    });
    
    // window creation
    var stateTreeWindow = function DrawStateTreeWindow(){
    stateTreeWin = desktop.createWindow({
                //id: 'statetree-win', // Commented id so that we can have multiple windows with different ids
                title: 'State Tree',
                iconCls: 'icon-statetree',
                shim: false,
                animCollapse: false,
                constrainHeader: true,
                items: [{..}]})
        }
    }

  5. #5
    Ext User mahendra_gayatri's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    58
    Vote Rating
    0
    mahendra_gayatri is on a distinguished road

      0  

    Cool


    Quote Originally Posted by Slimsuperb View Post
    yeah it's possible on how you want to structure your appliaction but you could start exploring here
    We dont have multiple window opening here!, from same desktop icon

  6. #6
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Ok, so you have an icon that has a handler. That handler refers to a function to do something....in your current case, create ONE window. So modify that function to create two windows, three windows, whatever you want...

  7. #7
    Ext User mahendra_gayatri's Avatar
    Join Date
    Jul 2008
    Location
    India
    Posts
    58
    Vote Rating
    0
    mahendra_gayatri is on a distinguished road

      0  

    Default


    No its not that handler..

    I need to create a single window instance everytime I click on icon.
    But right now when I click on icon, even though it creates multiple windows, the internal data gets all shared

  8. #8

  9. #9
    Ext User Slimsuperb's Avatar
    Join Date
    Nov 2008
    Location
    Nigeria
    Posts
    7
    Vote Rating
    0
    Slimsuperb is on a distinguished road

      0  

    Arrow RE:

    RE:


    mjlecomte is right. If you want to be able to create multiple window or different window from the same actionthe function that creates the windows have to be taking some parameters so as to know which window to return at runtime or if I missed the point like wanting to check if a particular window has been created so as not to create it again is that the problem?

Thread Participants: 2