ComboBox added to grid does not seem to fire the Change event when the Clear option is clicked

Hi there,
I have added a combo box using this code:
CompanyDropdown = new ej.dropdowns.ComboBox({
cssClass: "socombobox",
dataSource: EmptyDs,
showClearButton: true,
allowFiltering: true,
filterType: 'Contains',
filtering: CompanyFiltering,
change: CompanyChange,
fields:
{
text: "Value",
value: "Id",
}
});
CompanyDropdown.appendTo('#GridAnchorcompany_name');
In the CompanyFiltering function it connects to a web service to search for the companies in the database
The CompanyChange function is:
function CompanyChange(args) {
if (args.itemData != null) {
SelectedCompany = args.itemData.Id;
}
else {
SelectedCompany = 0;
}
}
The problem is that the Clear option does not consistently fire the Change event (and sometimes doesn't fire it at all)
Are there any other events that I could use?
Cheers James

1 Reply 1 reply marked as answer

PM Ponmani Murugaiyan Syncfusion Team May 10, 2021 11:50 AM UTC

Hi James, 

Thanks for contacting Syncfusion support. 

Query: The problem is that the Clear option does not consistently fire the Change event (and sometimes doesn't fire it at all). 
 
We would like to know you that the change event triggered when an item in a popup is selected or when the model value is changed by user. So, the scenario in which the change event is triggered when click on the clear icon is that the item should be selected. 

As a result, we suspect your reported scenario is when you type the text ‘abc', whether it is present in the datasource or not. When you click the clear icon, the text is cleared, but the change event is not triggered. Now, the filtering event will be triggered in this scenario to get the modified value as per your requirements. 


So, based on the details you have given, we suspect that the above mentioned scenario is the reported case from your end. If so, use the ComboBox component's filtering event to meet this requirement. If suppose, we misunderstood the reported case, please revert with a video demonstration of the issue replicating case, which will help us to investigate and provide you with a solution as soon as possible. 

Regards, 
Ponmani M 


Marked as answer
Loader.
Up arrow icon