Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to populate dynamic content in the list picker #19

Open
sankari123 opened this issue Nov 5, 2016 · 2 comments
Open

How to populate dynamic content in the list picker #19

sankari123 opened this issue Nov 5, 2016 · 2 comments

Comments

@sankari123
Copy link

I have an array which is created at run time. I want to use this array as the list.

venue_array=(["NGS","NGS"],["VMl","VM"],["KGS","KGS"],["BVB","BVB"]);

var config = { title: "Select a Venue", items: venue_array, selectedValue: "NGS", doneButtonLabel: "Done", cancelButtonLabel: "Cancel" };

@roberthovhannisyan
Copy link
Owner

Hi @sankari123 ,
Consider using map() method to convert each item of venue_array to an object with required properties:

venue_array = venue_array.map(function(e) { 
  var result = {};  
  result['text'] = e[0]; // or e[1]
  result['value'] = e[1]; // or e[0]
  return result;
});

@sankari123
Copy link
Author

Thanks for yr reply. I tried your code. But I get this msg.
[object Object],[object Object],[object Object],[object Object]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants