-
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?
-
I got it.
Instead of . use []
options[propertyNames[i]] = propertyValues[i];
Similar Threads
-
By semenov in forum Ext 3.x: Help & Discussion
Replies: 9
Last Post: 29 Jun 2010, 5:20 AM
-
By semenov in forum Ext 3.x: Help & Discussion
Replies: 0
Last Post: 26 Jun 2010, 12:28 PM
-
By roekoe in forum Ext 3.x: Help & Discussion
Replies: 0
Last Post: 11 Jan 2010, 6:58 AM
-
By ec-cts in forum Ext 2.x: Help & Discussion
Replies: 2
Last Post: 11 Apr 2008, 2:14 AM
-
By georgh in forum Ext 1.x: Bugs
Replies: 3
Last Post: 6 Aug 2007, 11:35 PM
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us