Results 1 to 8 of 8

Thread: How to load new view

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    36
    Vote Rating
    0
      0  

    Default How to load new view

    What is the proper way to load another view (e.g. after clicking on a button). I have Ext.Viewport.setActiveItem(Ext.create('MyApp.view.ui.Preferences')); which loads my view but none of the javascript works. When clicking on buttons they do not react to tap/release events, the select field onchange events are not triggered, etc.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    That should work as long as it's not before the launch method on Ext.application/Ext.setup fires.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Posts
    36
    Vote Rating
    0
      0  

    Default

    It does not seem to work. When I switch the "non working view" to the initial view everything works as expected. I am also using Designer 2, not sure if that has any effect?

  4. #4
    Sencha User
    Join Date
    Aug 2011
    Posts
    36
    Vote Rating
    0
      0  

    Default

    Is there something else that should be called after calling Ext.create on the class? I was able to make the 2 container views work by putting them into a generic nav container with card layout and linking the 2 views into it. However in one of my views I am creating a panel popup using Ext.create and the listeners are unresponsive. If I add this panel to the generic nav container the buttons work but it is overlayed on my initial screen and I only want it to appear at a specific time.

  5. #5
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    146
      0  

    Default

    Create the view, add it to the viewport and then set it to active via its itemId or index in the items collection.
    Aaron Conran
    @aconran

  6. #6
    Sencha User
    Join Date
    Aug 2011
    Posts
    36
    Vote Rating
    0
      0  

    Default

    Thanks Aaron. The add step seems to be the step I was missing from above. Ext.Viewport.add then Ext Viewport.setActiveItem

  7. #7
    Sencha User
    Join Date
    Aug 2011
    Posts
    36
    Vote Rating
    0
      0  

    Default

    The app is doing what I want however I keep getting the error


    • [COLOR=red !important]25192Uncaught Error: [ERROR][Ext.Container#setActiveItem] Setting activeItem to be a non-inner item[/COLOR]



    Should I be concerned?

  8. #8
    Sencha User
    Join Date
    Aug 2011
    Posts
    36
    Vote Rating
    0
      0  

    Default

    Another reason I found for the events not firing is having a value in the "id" field. Normally I don't need this but it's making it difficult to CSS style very specific screens. Should I be able to have an "id" value for the top level containers?

Posting Permissions

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