Create autocomplete for Select Option with JQuery?

0

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           
        });
    }
} 
    
asked by anonymous 29.11.2017 / 15:14

0 answers