We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Reset cascading DropDownLists

Thread ID:

Created:

Updated:

Platform:

Replies:

132267 Aug 23,2017 10:54 AM Aug 24,2017 02:37 AM JavaScript 1
loading
Tags: ejDropDownList
Carsten Buchmann
Asked On August 23, 2017 10:54 AM

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

Prince Oliver [Syncfusion]
Replied On August 24, 2017 02:37 AM

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: http://jsplayground.syncfusion.com/jqizikit 

Regards, 
Prince 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;