Results 1 to 3 of 3

Thread: Accessing form items

  1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    78
    Answers
    1
    Vote Rating
    0
      0  

    Default Answered: Accessing form items

    Is it possible to access form items on the basis of " fieldLabel"? (coz name and id can be dynamic)

  2. you can use component querys to get pretty much any component by any property.
    lets say you have field with fieldLabel = "someString"
    so you can do this
    Code:
    var field = myForm.query("[fieldLabel='someString']")[0];
    the [0] is because query() method returns all component that matched the search, so if theres more than one field with the same label it returns all, if you are sure you only haev one component with that label, just add and [0] to get the first element of the returned array.

  3. #2
    Sencha User
    Join Date
    Dec 2011
    Posts
    224
    Answers
    13
    Vote Rating
    10
      0  

    Default

    you can use component querys to get pretty much any component by any property.
    lets say you have field with fieldLabel = "someString"
    so you can do this
    Code:
    var field = myForm.query("[fieldLabel='someString']")[0];
    the [0] is because query() method returns all component that matched the search, so if theres more than one field with the same label it returns all, if you are sure you only haev one component with that label, just add and [0] to get the first element of the returned array.

  4. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    78
    Answers
    1
    Vote Rating
    0
      0  

    Default

    Thanks

Posting Permissions

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