我需要在 ajax 响应后重新创建多选

I need to recreate the multiselect after ajax response

我需要在“Local”中在“Empresa”ajax 响应后重新创建 multiselect有了这个数据响应。我将信息放入“Local”select,但无法重新创建“Local”multiselect .

$.ajax({
    url: '/ajaxrequests/requestlocals',
    type: 'POST', dataType: 'json',
    data: {empresas:empresas},
    success: function(retorno){
        console.log(retorno);
        $('#ajax_local').html("");
        $.each(retorno, function (valor, chave) {
            $('#ajax_local').append($('<option>', {
                value: valor,
                text : chave
            }));
        });
        $('#ajax_local').multiselect();
    }
});

先尝试摧毁它;

$("#ajax_local").multiselect('destroy');
$("#ajax_local").multiselect();