How to auto select *all* items in dependent jQuery multiselect dropdown lists? -
my requirement when select customer combobox, need able auto-select items in dependent jquery multiselect dropdown lists. following started with. suggestion/help !
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 items auto-selected in ddlservice $("#ddlservice").multiselect("checkall"); //i want items auto-selected in ddltype //which based on checked items in #ddlservice $("#ddltype").multiselect("checkall"); //i want items auto-selected in ddlsubtype //which based on checked items in #ddltype $("#ddlsubtype").multiselect("checkall"); } };
above .multiselect("checkall") ddltype , ddlsubtype not working, though ddlservice working. suggestion appreciated. thanks!!
Comments
Post a Comment