ovi_zit
December 10, 2017, 7:15pm
1
Hi,
I need a help on expanding tree nodes automatically when a new node is added or a item is added to one of the nodes.
Snippet: Code Snippet
Suppose, a new item is added at Skoda or a entire new noad with some leaf nodes got added to the tree. I want to make a function call from outside .js file to refresh that part of the tree without clicking the node manually.
How can I define the _expandTheNode function?
Any example of that would be very helpful.
ovi_zit
December 11, 2017, 6:28pm
3
Hi intregal,
Thanks for pointing those links.
I need to do it little different way than done in those link due to my requirement.
Let’s say I have the tree object as below:
var t = $$(‘myTree’);
Now, by using _htmlmap below way I get all the node ids:
t._htmlmap
and below code gives me the textual name(content) of each node :
t._viewobj.textContent
Is there a way to get the mapping of each node text and their corresponding id ?
Thanks
tree object has its own data store, which you can use to iterate ids
var nodes = [];
$tree.data.each(function(row){
nodes.push($tree.getItemNode(row.id));
})
ftedin
March 13, 2020, 6:14pm
5
Hi,
is there a way to disable automatically expand of a node when mouse over in a Drag and Drop operation? Thanks!
@ftedin
did you try onBeforeOpen handler?
on:{
onBeforeOpen: function(){
if(webix.DragControl.getContext())
return false
}
}
ftedin
March 17, 2020, 10:37pm
7
Yes, thanks, I found it after posting my question and forgot to add here the solution.
Thanks,