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 10, 2019 04:10 AM UTC

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.
Up arrow icon