L
L
Leopandro2018-02-19 03:49:22
JavaScript
Leopandro, 2018-02-19 03:49:22

Why can't select value from select2?

I posted the code here:
https://jsfiddle.net/vzexw4ky/24/
The essence is this - I enter a search, I select a value from the list, but it is not selected. The received data is correct, I checked it many times already. If you just add an option inside the select, then everything is fine.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ainur Valiev, 2018-02-21
@vaajnur

doc should read
https://select2.org/programmatic-control/events

$('#basic').on('select2:select', function (e) {
         var data = e.params.data;
         console.log('on select:')
         console.log(data);
        //console.log('on select: ' + $(this).val());
    });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question