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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Change of dataSource second time causes problems

Thread ID:





150528 Jan 9,2020 09:04 PM UTC Jan 15,2020 05:45 AM UTC Vue 4
Tags: ComboBox
Asked On January 9, 2020 09:04 PM UTC

  I'm having a problem with ejs-combobox. When I try to update the data element that's being used as the dataSource in the control (for the second time) the control does not behave as expected - the list reduces to just 1 element.
  If nothing is selected in the combobox the items are successfully refreshed. However, if an item is selected only that item remains in the list after this code is run.
See attached file for ejs-combobox projectFilter.

Attachment: Timesheets_870fb483.zip

Sevvandhi Nagulan [Syncfusion]
Replied On January 12, 2020 07:38 AM UTC

Hi LEE, 

Greetings from Syncfusion support. 

We have checked the shared sample. Due to the dependency problem we could not able to run the sample. So we have prepared the simple sample by changing the datasource in the button click. Please check the sample, 

Is still issue persists , kindly revert us below details that help us to proceed further. 

  1. Full runnable sample
  2. Package.json

Sevvandhi N 

Replied On January 13, 2020 06:30 PM UTC

  I modified your sample to use my app's combobox properties, and added a second button and method to set the datasource. 
  This behaves as my original did. When you click a button for the first time, the combobox populates correctly. However, clicking on the other button leaves just the 'None' entry and none of the sports listed. To replicate this behavior:

Click first Refresh button - note that dropdown is correct
Click second Refresh button - note that only "None" is in dropdown
Click first Refresh button - note that only "None" is in dropdown


Attachment: Sample_bed260f9.zip

Sevvandhi Nagulan [Syncfusion]
Replied On January 15, 2020 03:33 AM UTC

Hi LEE, 
We have checked your query and can able to reproduce the reported issue. Since you have given same Id for both datasource and you have enabled filtering, while updating the value property, filtering happens and the same value is set for both the cases . So we suggest you to call dataBind() method to reflect the value instantly. Please refer the below code snippet and get back to us if you need any further assist on this. 

refreshDataSource2: function() { 
var sportsData = [ 
{ Id: "-1", Game: "None" }, 
{ Id: "GameB", Game: "Baseball" }, 
{ Id: "GameS", Game: "Soccer" }, 
{ Id: "GameH", Game: "Hockey" } 
this.$refs.comboboxObj.ej2Instances.value = null; 
this.$refs.comboboxObj.ej2Instances.dataSource = sportsData; 
this.$refs.comboboxObj.ej2Instances.value = '-1'; 

Sevvandhi N 

Replied On January 15, 2020 05:45 AM UTC

Great...that seems to resolve the issue.

Thanks for the help & you can close this one.



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