I try to use the bootbox.js library. The question is how to dynamically create function parameters. For example, how to form an array of inputOptions options based on some of its own array in a loop. Well, for example, there is json
[ {"id":"2","language":"ENG","language_full":"ΠΠ½Π³Π»ΠΈΠΉΡΠΊΠΈΠΉ"}, {"id":"1","language":"RU","language_full":"Π ΡΡΡΠΊΠΈΠΉ"} ]
And how to get something from it suitable for insertion into inputOptions (see below)?
{ text: 'Π ΡΡΡΠΊΠΈΠΉ', value: 1, }, { text: 'ΠΠ½Π³Π»ΠΈΠΉΡΠΊΠΈΠΉ', value: 2, }, Here is an example of the function of the bootbox.js library
bootbox.prompt({ title: "This is a prompt with select!", inputType: 'select', inputOptions: [ { text: 'Choose one...', value: '', }, { text: 'Choice One', value: '1', }, { text: 'Choice Two', value: '2', }, { text: 'Choice Three', value: '3', } ], callback: function (result) { console.log(result); } });