How to add a new node to C1TreeView in client side?

  • JetLee 3 years, 4 months ago

    //get C1TreeView1 to add
    var trvw;
    trvw = Sys.Application.findComponent("C1TreeView1″);

    //ready to add a node
    trvw.get_nodes().clear();

    //how to create a node in client?
    // Can I write :"var node=new C1.Web.UI.Controls.C1TreeView.C1TreeViewNode(); " ? Can javascript support the type of "C1.Web.UI.Controls.C1TreeView.C1TreeViewNode"?
    trvw.get_nodes().add(aNode);

    Could you give me some sample code to add a new node to C1TreeView?

    thanks.

  • 8p
    Raleigh Johnson8p 3 years, 4 months ago

    Hello,
    A variation of the following should add the node on the client side:

        <script type="text/javascript">
            function Add() {
                var tv = $find("C1TreeView1");            
                var node = new C1.Web.UI.Controls.C1TreeView.C1TreeViewNode();
                node.set_text("Test");            
                tv.get_nodes().add(node);
            }
        </script>
    

    I hope this helps,
    -Raleigh

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.