1. #1
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    141
    Answers
    9
    Vote Rating
    1
    Fire-Dragon-DoL is on a distinguished road

      0  

    Default Answered: Should I dynamically instanciate a controller for a window dynamically created? How?

    Answered: Should I dynamically instanciate a controller for a window dynamically created? How?


    This is a desktop-like application (single page), with icons, taskbar and windows.

    I'm asking this because I really don't know where I should handle events of my dynamically created window.

    When someone clicks on a desktop icon, the window (if it doesn't exist) will be dynamically created. Should I create a controller when creating the window and hook to it? If yes, how?

    Here you can read different approaches I've thought about:
    1. Create a controller that will instanciate the Window (as its view), I will handle everything there
    2. Create the window only and hook everything in my taskbar controller (which is where the window is created). In this case, the Taskbar controller will become very big.
    3. Pre-create all window controllers and eventually windows too and hide them (when page is ready). Then just show/hide them, so I will have "static" references to all controllers with getController in Application
    Which approach should I use?

  2. I solved by myself by preallocating controller in Application object. Then I dynamically instanciate views and I can access those through refs in my controller.

  3. #2
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    141
    Answers
    9
    Vote Rating
    1
    Fire-Dragon-DoL is on a distinguished road

      0  

    Default


    Is possible to have a human readable version of extjs 4 desktop example? Because that it's compressed and I'm having really hard times in reading it.

  4. #3
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    141
    Answers
    9
    Vote Rating
    1
    Fire-Dragon-DoL is on a distinguished road

      0  

    Default


    I solved by myself by preallocating controller in Application object. Then I dynamically instanciate views and I can access those through refs in my controller.

  5. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,605
    Answers
    543
    Vote Rating
    326
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Quote Originally Posted by Fire-Dragon-DoL View Post
    Is possible to have a human readable version of extjs 4 desktop example? Because that it's compressed and I'm having really hard times in reading it.
    That example comes with the unminified source code and a build file.

  6. #5
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    141
    Answers
    9
    Vote Rating
    1
    Fire-Dragon-DoL is on a distinguished road

      0  

    Default


    I were talking about the online examples, I'll watch in local examples so, thanks.

Thread Participants: 1

Tags for this Thread