Hi Sonam,
Thank you for contacting Syncfusion support.
We have prepared a sample based on your requirement. Here we bind the dataSource to the treeview after the dispatch is called on button click. Please find the code snippet.
loadTree: function () {
store.dispatch(Click());
var tree = document.getElementById("tree").ej2_instances[0];
tree.fields.dataSource = store.getState();
tree.dataBind();
} |
Please find the sample from the following link.
You can use the following comments to make the sample runnable.
- npm install
- npm install react-scripts --save
- npm start
Please check the sample and let us know whether it fulfills your requirement.
Thanks,
Christo