Results 1 to 2 of 2

Thread: Duplicate DOM elements by including view by xtype in two different views

  1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    77
    Answers
    6
    Vote Rating
    2
      0  

    Default Duplicate DOM elements by including view by xtype in two different views

    I have an app that launches a view by xtype on startup to get the user to sign up. This view has some selectfields and all works as expected. The use also has the option to skip this view and access it later. When the user accesses this view at a later time, I have an issue where data is not being appended to the correct elements. The values are being set but running Ext.ComponentQuery.query('[itemId=item_name]') returns 2 elements. Somehow the elements of this view are getting duplicated.

    I have also tried setting autoDestroy: true on the config for this view but this has no effect whatsoever.

    I have also tried manually destroying the view using destroy() method on the deactivate() event. When I do this, the behavior turns strange and selecting an item from another pushed view and returning back to the profile screen causes the navigationview to break as if this view is not present. The header of the navigationbar breaks and the back button is incorrectly shown.

    Why are the view elements being duplicated? How can I prevent this.

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

    Default

    On the deactivate event, if you destroy() it by default it will be destroyed and removed from the parent. So if you try to go back to the view and create a new instance you should only have one.

    It's kind of hard to help you without any code or anything.
    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

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
  •