I have an ExtJS application. In my grid I am using the columns renderer function to return the select element drop down. My current implementation is below:
//grid col renderer fn
renderer:function(val, meta, rec) {
return [
'<select id="states" value="" disabled selected>Select...</option>'+
'<option value="CA">California</option>'+
'<option value="NY">New York</option>'+
'<option value="TX">Texas</option>'+
'<option value="FL">Florida</option>'+
'<option value="NJ">New Jersey</option>'+
'</select>'
];
and this all works fine but now the list of options is going to be dynamic. The sample JSON is below:
"states":[{"value":"CA","name":"California"},{"value":"Ny", "name":"New York"},{...}]
So I want to iterate the "states" array and create an option el for each object then push that option into the select element.
Thanks