Results 1 to 2 of 2

Thread: itemId vs id

  1. #1

    Default Answered: itemId vs id

    What is the difference between itemId and id in components? Let's say when it comes time to making refs - I have been using itemId in say my button config and then making a ref but I see that sometimes ID is implemented - the only diff I can see is that id goes in the dom. What is pros and cons? docs don't really specify

  2. Hi.

    As you say the Id goes into the DOM, and so you should only have one unique Id in the dom-wide scope.
    This is often a problem, since you never know about other Id's in the dom (unless you have created the complete app and page).

    ItemId is a fix/workaround for this problem, since it is a custom property, and you don't break the dom if you get duplicates. Then it's up to you to have unique ItemId's it the scope you choose to search for them in refs/selectors.

  3. #2
    Sencha Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    658
    Answers
    7

    Default

    Hi.

    As you say the Id goes into the DOM, and so you should only have one unique Id in the dom-wide scope.
    This is often a problem, since you never know about other Id's in the dom (unless you have created the complete app and page).

    ItemId is a fix/workaround for this problem, since it is a custom property, and you don't break the dom if you get duplicates. Then it's up to you to have unique ItemId's it the scope you choose to search for them in refs/selectors.
    Sven Tore Iversen

Posting Permissions

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