PhilChill
12 Apr 2012, 3:32 AM
Hey,
I have a form where inside is a select Field. I want to add options to this field. I found in the documentation only a setOptions function is there also a function like addOptions or do I have to use a store and save there the different options? My code in the controller looks so:
var agent = this.getSettingsAgent();
MobileLogin.app.callFn('account.getUsers', function(result,error){
console.log(result);
agent.setOptions({text: result[0].name, value: 'somevalue'},
});
As to see i get the selectField and named it agent. After that i make a server call which send me arrays back. I want to add data from the array in the select field. Did i really need to save the array in a store to add the options to the selectField?
I have a form where inside is a select Field. I want to add options to this field. I found in the documentation only a setOptions function is there also a function like addOptions or do I have to use a store and save there the different options? My code in the controller looks so:
var agent = this.getSettingsAgent();
MobileLogin.app.callFn('account.getUsers', function(result,error){
console.log(result);
agent.setOptions({text: result[0].name, value: 'somevalue'},
});
As to see i get the selectField and named it agent. After that i make a server call which send me arrays back. I want to add data from the array in the select field. Did i really need to save the array in a store to add the options to the selectField?