Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

108
Views
@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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!