DropDownList Change event

Hi,

the change event of the dropdownlist control does not fire when the clearText method is invoked which clearly changes the dropdownlist value

Please see the JSplayground:

How to capture changes on clearText?

1 Reply

PO Prince Oliver Syncfusion Team January 18, 2018 05:08 AM UTC

Hi Pratura, 

Thank you for contacting Syncfusion forums. 

The “Cleartext” method clears only the Selected text in the DropDownList and will not trigger the change event. if you need to remove the selected text and trigger the change event, we suggest you to use the selectedIndex property. Set the selectedIndex property to -1 to remove the selected item. Refer to the following code. 

function clearDropdown() { 
    var ddlobj = $("#dropDown").data("ejDropDownList"); 
    ddlobj.setModel({ selectedIndex: -1 });  
}; 

  
Refer to the following playground sample: http://jsplayground.syncfusion.com/3jaaivxh 

Regards, 
Prince 


Loader.
Up arrow icon