如何在依赖jQuery multiselect下拉列表中自动选择*所有*项?

如何在依赖jQuery multiselect下拉列表中自动选择*所有*项?,jquery,multi-select,Jquery,Multi Select,我的要求是,当我选择客户组合框时,我需要 能够自动选择依赖jquery multiselect中的所有项 下拉列表。以下是我开始的内容。谢谢你 建议/帮助 ddlType和ddlSubType的multiselectcheckAll不工作,即使ddlService正在工作。 如有任何建议,我们将不胜感激。谢谢 Telerik网格中的HTML助手方法。Telerik网格中的HTML助手方法。 This is Mvc View: <td>

我的要求是,当我选择客户组合框时,我需要 能够自动选择依赖jquery multiselect中的所有项 下拉列表。以下是我开始的内容。谢谢你 建议/帮助

ddlType和ddlSubType的multiselectcheckAll不工作,即使ddlService正在工作。 如有任何建议,我们将不胜感激。谢谢


Telerik网格中的HTML助手方法。Telerik网格中的HTML助手方法。
 This is Mvc View:
            <td>
                @if(ViewBag.Customer != null)
                {
                  @(
                     Html.Telerik().ComboBox()
                     .Name("ddlCustomer")
                     .BindTo((IEnumerable<SelectListItem>)ViewBag.Customer)
                     .ClientEvents(ce => ce.OnChange("ddlCustomer_OnChange"))
                   )
                }
            </td>

            <td>
                 @if (ViewBag.Service != null)
                 {
                   @Html.DropDownList("ddlService", (IEnumerable<SelectListItem>)ViewBag.Service, new { onchange = "ServiceChange()" })
                 }
            </td>

            <td>
                @if (ViewBag.Type != null)
                {
                  @Html.DropDownList("ddlType", (IEnumerable<SelectListItem>)ViewBag.Type, new { onchange = "ComponentChange()" })
                }
            </td>

            <td>
                @if (ViewBag.SubType != null)
                {
                  @Html.DropDownList("ddlSubType", (IEnumerable<SelectListItem>)ViewBag.SubType)
                }
            </td>

    //.js file 
    function ddlCustomer_OnChange(){
        var goldCustomer = "Gold Customer";
        var ddlCustomerCombo = $(this).data('tComboBox');
        var selectedOption = ddlCustomerCombo.text();

        if (selectedOption == goldCustomer){
            //I want to get all items auto-selected in ddlService  
            $("#ddlService").multiselect("checkAll"); 
            //I want to get all items auto-selected in ddlType
            //which are based on all the checked items in #ddlService    
            $("#ddlType").multiselect("checkAll");
            //I want to get all items auto-selected in ddlSubType
            //which are based on all the checked items in #ddlType
            $("#ddlSubType").multiselect("checkAll");   
        }
    };