Results 1 to 3 of 3

Thread: Add View and Controller Dynamically

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    24
    Vote Rating
    0
      0  

    Default Add View and Controller Dynamically

    Hi,

    I'm using this code to add a view based on user interaction:

    var rightPanel = me.getRightPanel();
    rightPanel.removeAll();
    rightPanel.add( Ext.widget('DetailsList') );

    I have created a controller that is linked to this view, but once I add the view, the controller doesn't recognize the view. I have some references defined and I'm listening for some events and they dont work.

    I've tried to check if the container has been loaded, by using:

    var controller = this.getController('DetailsListController');

    What would be the best way to handle this? I think remove both view and controller based on user interaction and then when I need the view again, create both?? how can accomplish that?

    Thanks

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997
    Vote Rating
    1524
      0  

    Default

    Your controllers should be loaded up front in Ext.application
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Answers
    102
    Vote Rating
    86
      0  

    Default

    I agree with Mitchell. Also, move away from Ext.widget, and use Ext.create.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •