Results 1 to 3 of 3

Thread: geItemId() returns id

  1. #1
    Sencha Premium User
    Join Date
    Nov 2015
    Posts
    19

    Question Answered: geItemId() returns id

    When I use the mehod getItemId() on a component and i have not set an itemId on this item, it falls back to the id of the item.

    Example on form-fields:
    Code:
    items: [{
       xtype:  'numberfield',
       label:  'myLabel1',
       itemId: 'myItemId'
    },{
       xtype:  'numberfield',
       label:  'myLabel2'
    }]
    1. getItemId() returns "myItemId"
    2. getItemId() returns "ext-numberfield-2"


    My question:
    Is that behavior wanted?
    If yes, is there a possibility to avoid that?

  2. It looks like this is expected behavior:
    http://docs.sencha.com/extjs/6.2.1/c...thod-getItemId

    I guess you'd have to override the method to disable this behavior.

  3. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    It looks like this is expected behavior:
    http://docs.sencha.com/extjs/6.2.1/c...thod-getItemId

    I guess you'd have to override the method to disable this behavior.

  4. #3
    Sencha Premium User
    Join Date
    Nov 2015
    Posts
    19

    Default

    Thank you Gary.
    This is what I expected.
    I'm currently developing in modern toolkit and the docs are there a bit different
    This one important sentence is missing: "Returns the value of itemId assigned to this component, or when that is not set, returns the value of id."

Similar Threads

  1. Solved ! btn value always returns '1'
    By altamirador in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 17 Apr 2009, 4:21 AM
  2. getActiveTab() returns ??
    By poppabear in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 28 Mar 2009, 3:17 AM
  3. [FIXED][2.x] Ext.num(NaN, 0) returns NaN
    By mystix in forum Ext 2.x: Bugs
    Replies: 8
    Last Post: 14 Mar 2009, 7:06 PM
  4. Messagebox returns
    By gutorb4 in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 22 Jan 2009, 2:25 PM
  5. It returns value from Json.
    By Perfect Lion in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 5 Oct 2007, 3:27 AM

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
  •