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. Image for the cookie policy date

changing index or value in code doesn't fire the 'change' event

When I change either the index or value of the dropdownlist in code, I need the 'change' event to fire.

ie:
           ddlOfc = document.getElementById("ddlOfficers").ej2_instances[0]
           ddlOfc.value = firstOff;

This changes the selected value, but it doesn't fire the 'change' event.

Mike

1 Reply

PO Prince Oliver Syncfusion Team April 9, 2019 08:10 PM

Hello Michael, 

Thank you for contacting us. 

Try calling the dataBind method to affect the changes in the control model immediately. Kindly refer to the following code. 

ddlOfc = document.getElementById("ddlOfficers").ej2_instances[0]; 
ddlOfc.value = firstOff; 
ddlOfc.dataBind(); // Call the dataBind method 

Let us know if you need any further assistance on this 

Regards, 
Prince 


Loader.
Live Chat Icon For mobile
Up arrow icon