Results 1 to 2 of 2

Thread: Getting a child component's index number

  1. #1
    Sencha User
    Join Date
    Dec 2008
    Location
    Sofia
    Posts
    267

    Default Getting a child component's index number

    Hello, how can i get the index position for particular component which is part of the items collection of its container?

    For example, i have a fieldcontainer with several text fields within. When i take some of these textfields - how to determine the field's insert position?

    Code:
    {xtype: 'fieldcontainer', 
      items: [
                {xtype: 'textfield', id: 1},{xtype: 'textfield', id: 2}...
               ]
    }
    When iterating trough the items of the fieldcontainer, how to determine that textfield with id: 1 has an index 0 in the items collection of its container?

    Is there something like 'getMyPositionInTheContainer()'

  2. #2
    Sencha User
    Join Date
    Sep 2011
    Posts
    574
    Answers
    59

    Default

    No, but you can try container.items.indexOf(child).

Posting Permissions

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