yAdEs
4 Apr 2012, 9:09 AM
Guys,
I wanna set properties of a textfield via loop the store, code is like this(just for example):
Like I hava a textfield and store:
var field = Ext.create('Ext.field.textfield');
var store = Ext.create('Ext.store.Store'){
field :[
{
name: 'x',
value: 99
},
{
name: 'y',
value: 100
},
{
name: 'width',
value: 220
}
]}
Now I loop the store and set the specified property of the textfield:
var index;
for(var i = 0; i < store.length; i++)
{
index = store[i].name;
field.index = store[i].value; //It's wrong even I want to use it in this way
}
I can set properties via 'applyIf' or 'setWidth' methods, but now I really need to do it like this.
Is there a 'getAttribute' method for component just like that for element so that I can change the code to "field.getAttribute(index) = store[i].value" ?
Or other solutions?
Thanks in advance!
I wanna set properties of a textfield via loop the store, code is like this(just for example):
Like I hava a textfield and store:
var field = Ext.create('Ext.field.textfield');
var store = Ext.create('Ext.store.Store'){
field :[
{
name: 'x',
value: 99
},
{
name: 'y',
value: 100
},
{
name: 'width',
value: 220
}
]}
Now I loop the store and set the specified property of the textfield:
var index;
for(var i = 0; i < store.length; i++)
{
index = store[i].name;
field.index = store[i].value; //It's wrong even I want to use it in this way
}
I can set properties via 'applyIf' or 'setWidth' methods, but now I really need to do it like this.
Is there a 'getAttribute' method for component just like that for element so that I can change the code to "field.getAttribute(index) = store[i].value" ?
Or other solutions?
Thanks in advance!