1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    5
    Vote Rating
    0
    Ashw!n is on a distinguished road

      0  

    Default Unanswered: Set the properties dynamically from an array

    Unanswered: Set the properties dynamically from an array


    var propertyNames = {'fieldLabel', 'minLength'};
    var proetyValues = {'first Name','10'};


    var options = {};

    for(i=0, n= propertyNames.length; i<n ;i++){
    options.propertyNames[i] = propertyValues[i];
    }

    new Ext.form.TextField(options);


    Is this way possible to set the properties from an array or json dynamically.?
    When I was using the property names are not substitued.

    Any ideas?

  2. #2
    Sencha User
    Join Date
    Dec 2010
    Posts
    5
    Vote Rating
    0
    Ashw!n is on a distinguished road

      0  

    Default


    I got it.

    Instead of . use []

    options[propertyNames[i]] = propertyValues[i];

Similar Threads

  1. extending and 4 questions about dynamically change properties
    By semenov in forum Ext 3.x: Help & Discussion
    Replies: 9
    Last Post: 29 Jun 2010, 5:20 AM
  2. extending and 4 questions about dynamically change properties
    By semenov in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 26 Jun 2010, 12:28 PM
  3. Form editor for an object with multiple array properties
    By roekoe in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 11 Jan 2010, 6:58 AM
  4. How to changing dynamically values and properties other fields
    By ec-cts in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 11 Apr 2008, 2:14 AM
  5. Replies: 3
    Last Post: 6 Aug 2007, 11:35 PM