eu81273 / angular.treeview

AngularJS based Treeview (no jQuery)
MIT License
405 stars 223 forks source link

can we select any partcular node by programmatically and open the tree upto selected node #31

Open srikanthrapolu opened 10 years ago

srikanthrapolu commented 10 years ago

can we select any partcular node by programmatically and open the tree upto selected node

DrCherry commented 10 years ago

I've also been trying to figure this out. I've got code that adds data to the tree object but I lose my node highlighting when when I re-draw. I'd like to re-highlight a node after this but I can't find the node. I thought something like $scope.tree.currentNode.selected = 'selected'; might work but no luck.

otoja commented 10 years ago

Try to remove highligh from previous node first (set currentNode to undefined), then assign new node to currentNode and set is and selected. That works for me fine.

RamaduraiJayaraman commented 9 years ago

We have to pass the particular node information in to selectednode function. It will work. Make sure all values should match with tree view node.

$scope.tree02.selectNodeIcon($scope.ResultFindElement, 1);

selectNodeIcon is the functionality we have to mention it on initialization.

$scope.ResultFindElement is tree view node what we have to select.

data-ng-click="' + treeId + '.selectNodeIcon(node)

Amenel commented 8 years ago

@RamaduraiJayaraman : there is no selectNodeIcon function. And no "selectednode function".

kai-up commented 7 years ago

$scope.treeviewId.selectNode(targetNodeObj);

done! see the template in the directive of source code

sankarmahadevan commented 6 years ago

Hi all, I struck at one point in angular.treeview. I'm trying to show a folder opened dynamically after an update happened in database. Please help me, how to do this. This is my directive `appMod.directive("treeModel", function($compile) { return {
restrict: "A", link: function(a, f, b, scope) {
var d = b.treeModel, g = b.nodeLabel || "label", c = b.nodeChildren || "children", h = '