Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

110
Visualizações
@html.dropdownlistfor jquery multiselect do not refresh

I am doing an MVC app and I have a 3 dropdown list. When it change the value from any or those, it load a third dropdowlist multiselect defined like this

 @Html.DropDownListFor(model => model.ListEntityItem, Model.EntityItems, new { id = "lstData", multiple = "multiple" })

it is loaded like this

function loadData()
        {
                 var source = $("#ddlOrigin").val();
                 var entity = $("#ddlEntity").val();
                $.ajax({
                    url: '@Url.Action("GetData","EntitySync")',
                    data: { entity: entity, source: source },
                    cache: false,
                    type: "POST",
                    success: function (data) {
                        document.body.style.cursor = "auto";
                        var markup = "";
                     
                         $("#lstData").css("display", "block");
                        for (var x = 0; x < data.length; x++) {
                            markup += "<option value=" + data[x].Value + ">" + data[x].Text + "</option>";
                        }
                        $("#lstData").append(markup).show();
                        $('#lstData').multiselect({
                            columns: 1,
                            placeholder: 'Select Workflow Items',                            
                        });

                        $('input[type=checkbox]').change(function () {
                            if ($('input[type=checkbox]:checked').length > 0)
                                $("#btnSync").prop("disabled", false);
                            else
                                $("#btnSync").prop("disabled", true);
                        });
                    },
                    error: function (response) {
                }
            })
        }

From this moment... the DropDownList lstData is Inaccessible. If i want to hide it, Nothing happends.

$("#lstData").css("visibility", "hidden");

If i change the options in the firsts DropDownList... its draws another DropDownList... above the first one.

enter image description here

I read differents pages, but nothing works.. here or here

How can i solve this..?

Thanks

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda