Closed fdelval closed 3 years ago
Hi,
For the moment, we can reload treeview data because the treeview don't accept data url to refresh. You can clear the html dom element of treeview and then build it again.
Thanks
Note: This works in v1.0.0.
Based on the solution provided by @chniter, do the below:
Remove the TreeView element.
$('#TreeViewDiv').remove();
Append the TreeView element.
$('#ParentDiv').append('<div id="TreeViewDiv"></div>');
Build the TreeView again.
$('#TreeViewDiv').bstreeview({
data: JSON.stringify(treeViewData),
expandIcon: 'fa fa-angle-down fa-fw',
collapseIcon: 'fa fa-angle-right fa-fw',
indent: 1.25,
parentsMarginLeft: '1.25rem',
openNodeLinkOnNewTab: true
});
Hi, I am just using the plugin retrieven data in json format from a database.
As soon as a user inserts new records in database, I refresh page to see new nodes.
Is there a way to refresh the plugin without reloading the whole page? Something like $('#treeview').bstreeview().reload();
I have read about unbinding events. But I can't figure out how to do it.
Any help would be appreciated. Thank you.