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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

143897 Apr 9,2019 09:51 PM UTC Apr 10,2019 04:10 AM UTC ASP.NET Core - EJ 2 1
loading
Tags: Dropdown List
Michael Lambert
Asked On April 9, 2019 09:51 PM UTC

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

Prince Oliver [Syncfusion]
Replied On 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 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon