This is a migrated thread and some comments may be shown as answers.

add an item onExpand

1 Answer 13 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Yingyi
Top achievements
Rank 1
Yingyi asked on 09 Aug 2013, 04:11 PM
I have tried to add an item to treeview when user click expand icon.  But it doesn't work.

Please help.

function onExpand(e) {
  var expandedNode = e.node;
 if (expandedNode.length == 0) {
      expandedNode = null;
}
treeview.append({
text: 'newNode'
}, expandedNode);

}

1 Answer, 1 is accepted

Sort by
0
Accepted
Yingyi
Top achievements
Rank 1
answered on 09 Aug 2013, 06:06 PM
I solved the issue by using the findByText method to find the node and worked. 
var foundNode = treeview.findByText(this.text(e.node));
Tags
TreeView
Asked by
Yingyi
Top achievements
Rank 1
Answers by
Yingyi
Top achievements
Rank 1
Share this question
or