Closed pixelplant closed 7 years ago
Looks like you are overriding the array and not adding / removing nodes from it. For this you will need to redraw the tree. Check the readme of the project
Oh yes, you were right. I thought we needed to recreate it only if we needed a different config for it, not if we completely need to switch the data. I just needed to increment the version, as the variable was already defined and now it works.
One more question: I had this config initially which worked just fine, and this loaded the tree data from a json file the first time the tree was displayed. This was defined in $scope.pageTreeConfig data: { url: 'temp/page_tree.json', data : function (node) { return { 'id' : node.id }; } }
With ngJsTree it does not seem to work though, as no data is loaded once jsTree starts, so how can we trigger a call to fetch the pages once the tree loads with ngJsTree?
Thanks again
check the demo page code.. it is adding nodes in async way
Hello hello :)
I'm using Angular 1.5.8 and the latest version of jsTree and ngJsTree.
I managed to get my tree to load some data but the tree does not seem to update once I update the model data.
In my controller I have this code defined:
Now, this initial data, these 2 nodes, show up just fine in jsTree, but once I change the value of the model the tree is not updated. It still shows only these 2 nodes and not the new ones...
In my view I have this:
This is my tree config:
pageTreeEvents is called just fine, I can see my $log.info data.
Now, on a button I have an ng-click event that gets called, inside it an ajax call is made that is supposed to update the $scope.pageTreeData model but the jsTree is not updated:
This is my ng-click call:
Log info shows the right data in the model but nothing changes in the jsTree... Anyone has an idea why it's not updating? Do I need to update it manually, through another call?
Thanks