I use Select2 to handle my dropdownmenu. The dropdownmenu get's populated via "Ajax-call" to PHP, who get's data from Mysql.
The Select2 dropdownmenu offers serach function and filtering. When i type in something in the search field, the letters get underlined, but the filter doesn't work. So the list won't get filtered by the letters i type in. Why?
JS:
$(document).ready(function(){
$("#test").select2({
placeholder: "test",
minimumInputLength: 1,
ajax: {
url: "test.php",
dataType: 'json',
//search term
data: function (term, page) {
return {
q: term, // search term
page: page
};
},
results: function (data, page) {
return { results: data};
} //End of results
}, //End of Ajax
}); //End of select2