add an item onExpand

2 posts, 1 answers
  1. Yingyi
    Yingyi avatar
    5 posts
    Member since:
    Aug 2010

    Posted 09 Aug 2013 Link to this post

    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);

    }
  2. Answer
    Yingyi
    Yingyi avatar
    5 posts
    Member since:
    Aug 2010

    Posted 09 Aug 2013 Link to this post

    I solved the issue by using the findByText method to find the node and worked. 
    var foundNode = treeview.findByText(this.text(e.node));
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top