Reset cascading DropDownLists

Hi,

I got three DropdownLists and the first cascade to the second and this one to the third. Now I want add a button which clear all dropdownlists and they will show up all items again.

I tried with:

ddl.selectItemByValue(-1);
ddl.clearText();

But with no success.

Do you got any ideas?

Kind regards,
Carsten

1 Reply

PO Prince Oliver Syncfusion Team August 24, 2017 06:37 AM UTC

Hello Carsten, 

Thank you for contacting Syncfusion forums. 

To clear a selected value in the DropDownList, you can set selectedIndex property to -1 by accessing the control’s instance. Kindly refer to the following code snippet.   

$("#btn").on("click", function(){ 
    ddl1.setModel({selectedIndex: -1}); 
    ddl2.setModel({selectedIndex: -1, enabled: false}); 
    ddl3.setModel({selectedIndex: -1, enabled: false}); 
}); 

Kindly refer to the following playground sample: https://jsplayground.syncfusion.com/jqizikit 

Regards, 
Prince 


Loader.
Up arrow icon