I'm trying to autocomplete using select
with jquery but I can not. How to do this?
I'm trying this way
function fillSelect(data) {
//$('#usuarioSelected').empty();
if (data['InvestidorMaster'].length > 0) {
//$.each(data["InvestidorMaster"], function (i, cp) {
// $('#usuarioSelected').append('<option value="' + cp.id + '">' + cp.nome + '</option>');
//});
//fill select without autocomplete it works
//autocomplete
var suggestions = [];
$.each(data["InvestidorMaster"], function (i, cp) {
suggestions.push({ 'value' : cp.id, 'label' : cp.nome});
});
$("#usuarioSelected").autocomplete({
source: suggestions
});
}
}