Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i add a new tree to the same div? #25

Open
LaNoriainnova opened this issue Jun 17, 2021 · 4 comments
Open

How can i add a new tree to the same div? #25

LaNoriainnova opened this issue Jun 17, 2021 · 4 comments

Comments

@LaNoriainnova
Copy link

LaNoriainnova commented Jun 17, 2021

im building a dynamic tree for this i call a method which builds the tree, but when i call the same function so it can build the new tree when a get to the part of $('#tree').bstreeview({data: json});
it dosen't do nothing

// this is just an example

function buildsTreeDyanamic(){
// the values of this json changes every time the function is call
var mydynamictree = [
{
icon: "fa fa-globe fa-fw",
text: "Go to Google",
class: "text-info",
href: "https://google.com"
}
];
// it does print the tree ithe first time, but when a clean that div and call the function again the tree dosen´t appear
$('#tree').bstreeview({data: mydynamictree });
}

@revolution-webmaster
Copy link

Did you find a solution for this? I'm having the same issue.

@sunnysonic
Copy link

same problem....

@Mjalid
Copy link

Mjalid commented May 19, 2022

same problem.... is there a solution to refresh or reload a dynamic tree
Thanks

@salihahmp
Copy link

$('#treeview').empty(); //to empty the div
$('#treeview').removeData(); // to recall the js function (need to put or else it will not show any treeview)

I add above code before calling .bstreeview function and it works.
$('#treeview').bstreeview({
data: bor,
//expandIcon: '',
//collapseIcon: '',
indent: 1.25,
parentsMarginLeft: '1.25rem',
openNodeLinkOnNewTab: true,
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants