Open Mjalid opened 2 years ago
@Mjalid Are u able to find the solution?
I try this code ;
$('#tree').empty(); //to empty the div $('#tree').removeData(); // to recall the js function (need to put or else it will not show any treeview)
You can try replace above code with $('#tree').html(''); //, see if it works, because it works on my side.
Note: This works in v1.0.0.
Based on the solution provided by @chniter in Issue #24, 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
});
I reset the tree and reload a new updated tree but no success : $('#tree').html(''); // $('#tree').bstreeview({ data: json, // a New json expandIcon: 'fa fa-angle-down fa-fw', collapseIcon: 'fa fa-angle-right fa-fw', indent: 1.25, parentsMarginLeft: '1.25rem', openNodeLinkOnNewTab: false }); Does anyone have a solution for this please ? Many thanks