Results 1 to 2 of 2

Thread: .setValues for array form fields

  1. #1
    Sencha User
    Join Date
    Jan 2011
    Denver, Co
    Vote Rating

    Default .setValues for array form fields

    I have a large form that allows users to save to and open from a database. When loading data from the database I am using the setValues method (see code below) that way I can reference each input by its name. This is working fine until I get to inputs on the form that I have set as an array. Is there a simple way to load these values using this same method. I am thinking of just giving these inputs an id and referencing them by id during the load process, but I would prefer to not have to do that for every time I have a form that uses arrays.

    This does not work
     field_a     : value_a,
     field_b     : value_b,
     field_c[0]  : value_c[0],
     field_c[1]  : value_c[1]
    Any Suggestions?

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    id is not a good idea for production. If setValues don't fit your needs, iterate through the items and set the value on each field but this way you can add some logic, that's what setValues does.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:

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