Page 1 of 1

Populate a Select component via Javascript ou JQuery

Posted: Tue Sep 26, 2017 7:26 pm
by Josiel Denardi6690187

I need to make a loop (for) for populate a SELECT component in real time.

What proprities that I will have to use for make this?

In browser in the web page I did:

Code: Select all

         var campo_select = document.getElementById('mecanico'); 
         campo_select.options.length = 0;    
         for (var i = 0; i < jsonData.mecanico.length; i++) { 
             var counter = jsonData.mecanico[i]; 
             campo_select.options[i] = new Option(counter.mecanico_name, counter.mecanico_id); 
         }

Populate a Select component via Javascript ou JQuery

Posted: Tue Sep 26, 2017 7:51 pm
by Serhii Kulibaba

Hello Josiel,

Please use the mapping for that like: https://docs.appery.io/docs/appbuilde...


Populate a Select component via Javascript ou JQuery

Posted: Tue Sep 26, 2017 8:47 pm
by Josiel Denardi6690187

Hi,

Don't is rest service result, I will to generate a Select components of the 1950 at current year for user to select the year of the car manufactured.


Populate a Select component via Javascript ou JQuery

Posted: Wed Sep 27, 2017 5:03 am
by Galyna Abramovych

Hello Josiel,

I am sorry but could you please clarify what exactly you are planning to do? Is it kind of sorting?