NodeEdit does not fire on edit of new node

2 posts, 0 answers
  1. Marbry
    Marbry avatar
    123 posts
    Member since:
    Aug 2012

    Posted 20 Jul 2011 Link to this post

    It works fine when editing an existing node, but when adding a new node and setting startEdit for that node it doesn't fire the server side NodeEdit event after entering the new text.

    Adding the new node appears ok on the client side, it gives me a new node and goes into edit, but I never hit the server NodeEdit handler.  I have postback disabled on the context menu for Edit and Add specifically to handle those in NodeEdit.

    Is there something else I need to specify on the client side to get that node hooked up?

    Here is my client side code:

    function onClientContextMenuItemClicking(sender, eventArgs)
            {
                var node = eventArgs.get_node();
                var item = eventArgs.get_menuItem();
      
                if (item.get_text() == "Edit")
                    node.startEdit();
                else if (item.get_text() == "Add")
                {
                    var newnode = new Telerik.Web.UI.RadTreeNode();
                    newnode.set_text("New Item");
                    node.get_nodes().add(newnode);
                    newnode.startEdit();
                }
            }

  2. Marbry
    Marbry avatar
    123 posts
    Member since:
    Aug 2012

    Posted 20 Jul 2011 Link to this post

    Never mind, I answered my own question.

    Called trackChanges() before adding, and commitChanges() after adding in client script.
Back to Top