Software Archive
Read-only legacy content
17060 Discussions

Fill select on app initialize

Tony_T_
Beginner
570 Views

In www/js/init-apps.js I have established communication with server and retrieved data needed to fill select. On page #mainpage I have a select I would like the options to be the retrieved data from server. How do I fill the options list on #mainpage select control from init-apps.js or do I need to put a button on #mainpage and fill from there? So far I have not come up with a way to do it from init-app.js this the way I would prefer to fill the select. That way when app shows select will be filled and all user has to do is make selection, enter username and password and login in.

0 Kudos
1 Reply
Swati_S_Intel1
Employee
570 Views

You should have one default options list in your html file and then you can change the options in app.js file after you get the values from server. Use ids in your options elements and replace the text of those elements in app.js with new values.

 

0 Kudos
Reply