I was able to make Plugin Select2 work, but autocomplete does not work.
$(function () {
$("#disciplina").select2({
placeholder: "Disciplina",
minimumInputLength: 0,
ajax:{
url: "busca.asp",
type: "post",
dataType: "json",
delay: 150,
data: function(params){
return{
text: params.term
};
},
processResults: function(data, params){
params.page = params.page || 1;
return{
results: data,
pagination:{
more: (params.page * 30) < data.total_count
}
};
},
cache: true
}
});
});
Hasanyoneeverbeenthroughthis?
Returnwithconsole.log(data);
console.log(params);