I'm trying to use Bootstrap + Chosen in my select option
to make a combobox with autocomplete .
But I'm doing the fill of select dynamically with jquery.
But when implementing Bootstrap + Chosen, the dynamic fill does not work, whereas the chosen one works, and if I get the chosen dynamic fill works.
My padding looks like this:
function carregarComboSetor( idSetor ){
$.ajax({
url : 'funcao/setor.php',
type : 'post',
dataType : 'json',
data : {
acao : 'S',
cdsetor : idSetor
},
success : function (data) {
var op = "<option value='0'>Selecione um setor</option>";
$('#setor').append(op);
$.each( data.setor, function (key, value) {
var option = "";
if( idSetor === value.codsetor ){
option = "<option value='"+ value.codsetor +"' selected>"
+ value.nmsetor
+"</option>";
}else{
option = "<option value='"+ value.codsetor +"'>"
+ value.nmsetor
+"</option> ";
}
$('#setor').append(option);
} );
$('#setor').val( idSetor );
}
});
}
EDITIONS 1
In the console only shows these texts