Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: [CLOSED]Ext IDs

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,105
    Vote Rating
    553
      0  

    Default [CLOSED]Ext IDs

    Is it possible to make Ext IDs more consistent?

    Here's an example:

    Code:
    // Current
    <div id="ext-gen1013" class="x-window-body x-layout-fit" ...
    <div id="component-1033" ...
    
    // Proposed change
    <div id="x-gen-1013" class="x-window-body x-layout-fit" ...
    <div id="x-component-1033" ...

  2. #2
    Ext JS Premium Member
    Join Date
    May 2007
    Posts
    64
    Vote Rating
    0
      0  

    Default

    or possibly disable?

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

    Default

    I wouldn't disable it, not that I use them for anything but debugging.

    So my question to the OP is, does it really matter?
    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

  4. #4
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,676
    Vote Rating
    9
      0  

    Default

    only important is that they are unique. By DOM explore you know if they are components or where they do belong, nothing more. I see no advantage to have "x-.." instead.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,626
    Vote Rating
    56
      0  

    Default

    Consistent with what?

    Component encapsulating elements are given the ID of that Component. That is very useful for debugging,
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

  6. #6
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,105
    Vote Rating
    553
      0  

    Default

    I see that the IDs are now more informative compared to Rel 3, and I like it.

    >>> Consistent with what?

    The format is not consistent. See the example that I pasted. In one place the ID is prefixed with "ext" and in another place, there's no prefix. The prefix "ext-gen" could be replaced by simply "x-". You can skip the "gen" part. It obvious that this is an Ext-generated ID.

    I'd like to have the "x-" prefix (as in class names) for widget IDs. This is a quick visual clue that the ID was generated by Ext. I like class name format better.

  7. #7
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,105
    Vote Rating
    553
      0  

    Default

    Another example.

    See ext-4.0-pr3/examples/form/anchoring.js

    The ID format in this example of these IDs is not consistent:

    "ext-gen1032"
    "textfield-1017"
    "x-form-item-body-ext-gen1038"

    These are all Ext generated IDs.

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

    Default

    Can I ask a question again? Does this matter at all?
    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

  9. #9
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,105
    Vote Rating
    553
      0  

    Default

    Quote Originally Posted by mitchellsimoens View Post
    Does this matter at all?
    The only requirement is that the ID is unique - we could have a random number in place of the ID and this would work.

    BUT, a consistent well thought out ID format can at a glance provide more useful information.

    Take a look at the Ext class names. They have a consistent format and are informative.

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

    Default

    Ok... when do you use the IDs of the DOM elements?
    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

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 16 Aug 2009, 11:37 AM

Posting Permissions

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