Results 1 to 3 of 3

Thread: 2 items with same id

  1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    425

    Question 2 items with same id

    Hi,
    A very basic question.
    I have a Ext.window. In that I put a grid with id 'grid1'.
    What happens if I put another grid with the same id in the window?
    Does the first grid get destroyed or the id of the first grid get changed?

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    20

    Default

    I think this is not possible. Id is allways unique and by pasing 2 elements with the same Id coused an error or your page stop rendering from that point on.

    greets streha

  3. #3
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    It's possible and this is why I (and many others) have always talked against using id.

    If you have two Components with the same id, the first will not get destroyed but will be lost. Things get put into the ComponentMgr so last one to be created will be the only one tracked by ComponentMgr. The first will still be rendered and usable but won't be tracked.
    Mitchell Simoens @LikelyMitch

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

    Posts are my own, not any current, past or future employer's.

Posting Permissions

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