Notifications
Clear all
BugOverflow
2
Posty
1
Users
0
Reactions
1,647
Widok
0
14/07/2016 1:24 pm
Topic starter
how to? ajax, jquery
2 Answers
0
14/07/2016 1:32 pm
Topic starter
1 2 |
var newOption = new Option("visible text",id_value, true, true); $("#my_select").append(newOption).trigger('change'); |
var newOption = new Option("visible text",id_value, true, true); $("#my_select").append(newOption).trigger('change');
0
14/07/2016 4:47 pm
Topic starter
and try this
1 |
$("#asd").select2('destroy').empty().select2({data: [{id: 1, text: 'new text'}]}); |
$("#asd").select2('destroy').empty().select2({data: [{id: 1, text: 'new text'}]});