I’ve setup a form using the forging-titanium-episode-10-forms modules as my template
On some of the picker field I’d like to be able to push dynamic array to the picker.
My problem is when I use the alert command I can see all the array elements, but I can’t add the array to the picker.
Can any one tell me how I can do this preferably using the forging-titanium-episode-10-forms template, without creating a new picker.
Thanks.
///////////////////////////////////////////////////////////////////
var list = CSVToArray (csv);
var arrFullName = [];
var arrEmail = [];
var arrGrade = [];
// Loop through both dimensions
for (var i = 0; i < list.length; ++i) {
var entryF = list[i][0];
arrFullName[i-1] = entryF;
var entryE = list[i][1];
arrEmail[i-1] = entryE;
var entryG = list[i][2];
arrGrade[i-1] = entryG;
}
alert(arrFullName);
alert(arrEmail);
alert(arrGrade);
////////////////////////////////////////////////////////////
var fields = [ { title:'Student', type:'text', id:'Student' },
{ title:'Grade', type:'picker', id:'Grade', data:[arrGrade]},
1 Answer
Sorry, I've just found a solution, had to remove the bracket around array object.
{ title:'Grade', type:'picker', id:'Grade', data: arrGrade },
Your Answer
Think you can help? Login to answer this question!