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
close icon

Using dynamic data

Dear support,

I have a component what loads data from a database using a service and then gives that data to the tree view component. When i check a node the service updates the checked state in the database. I have a refresh button on the component what is used to download the latest states from the database ( this function loads the data on the first start too. ). When i check a parent node then it update the database but when I download it with the refresh button and gives it to the data source property then it appears wrong.

This is how it looks like when i check the 'Alagsor' node:
 
And this is how it looks like when i reload it from the api:



When i start my component I make a subscription to rendelok$ observable and when i get data from it i give it to the dateSource property of the treeview component



Thanks in advance,
David

3 Replies

AB Ashokkumar Balasubramanian Syncfusion Team September 23, 2019 04:32 AM UTC

Hi David, 
 
Good day to you. 
 
We have validated the reported issue and tried to reproduce the issue at our end. But unfortunately, we could not able to replicate the issue.  
 
 
In the above sample we have rebind the same datasource once the user checks a node and click on the refresh button. 
 
If you are still facing the issue with the getting updated datasource after checking the node, we need more information to proceed further on this and provide you a solution as early as possible. 
 
a.     Whether you are using any adaptor to fetch the data from the remote end 
b.     Share the sample which you tried from your side 
c.      If possible, kindly reproduce the problem with the above-attached sample and share it with us. 
 
Kindly share the above-asked information if the issue persists. It would be more helpful to assist you better. 
 
Regards, 
Ashokkumar B. 



HO Horváth September 27, 2019 12:46 PM UTC

Hi!

Sorry for the late response!

I managed to reproduce my problem based on Your example: https://stackblitz.com/edit/angular-tejvuu-zcafa8

When the component starts, it downloads the data via subscribing to the fakeApiService.dataFromApi subject. If we push the refresh button it downloads the data again and load it into the datasource.

Steps to reproduce the problem: 
  1.      for example uncheck "KEK telephely 01" > "Épület A"
  2.      then click the refresh button
the result should look like this: 
but it look like this: 


Thanks in advance, 
David


AB Ashokkumar Balasubramanian Syncfusion Team September 30, 2019 10:41 AM UTC

Hi Horváth, 
 
We have validated the reported issue and the reported issue has been already resolved in our latest beta version. We suggest you upgrade the ej2-angular-navigations-packages to the latest 17.3.9-beta version to overcome the reported issue.  
 
 
Note: In the above sample, we have used the getTreeData method of the TreeView component to get the updated data source. However, you can replace this data with the latest data from your database. 
 
Kindly check the above sample and let us know if you need any further assistance. 
 
Regards, 
Ashokkumar B. 


Loader.
Live Chat Icon For mobile
Up arrow icon