Change Node Text on ClientNodeEditStart

8 posts, 0 answers
  1. Rob
    Rob avatar
    23 posts
    Member since:
    Apr 2013

    Posted 05 Sep 2013 Link to this post

    Hi,
    I need to achieve the following:
    when I start editing node on the client side, I need to set value to 'Rename' in input area.
    Please help.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 Sep 2013 Link to this post

    Hi Rob,

    Please have a look at the following code I tried to rename a node on selecting the Rename option from the RadTreeViewContextMenu

    JavaScript:
    <script type="text/javascript">
        var selectedoption = null;
        var selectednode = null;
        function OnClientContextMenuItemClicking(sender, args) {
            selectedoption = args.get_menuItem().get_text();
            selectednode = args.get_node();
            if (selectedoption == "ReName") {
                nodeEdit();
            }
        }
        function nodeEdit() {
            selectednode.set_text("Rename");
            selectednode.startEdit();
        }
    </script>

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rob
    Rob avatar
    23 posts
    Member since:
    Apr 2013

    Posted 06 Sep 2013 Link to this post

    Hi, Princy,

    I am not using RadTreeViewContextMenu. I would like to achieve this functionality on double click.
    Could you help please.
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Sep 2013 Link to this post

    Hi Rob,

    Please try the following code snippet to rename a node on double click.

    JavaScript:
    <script type="text/javascript">
        function OnClientDoubleClick1(sender, args) {
            args.get_node().set_text("Rename");
            args._node.startEdit();
        }
    </script>

    Thanks,
    Princy.
  6. Rob
    Rob avatar
    23 posts
    Member since:
    Apr 2013

    Posted 09 Sep 2013 Link to this post

    Hi, Princy,

    This code snippet works only in Internet Explorer for me, but doesn't work in Firefox, Safari, or Chrome.

    Please help.

  7. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 09 Sep 2013 Link to this post

    Hi Rob,

    Unfortunately I couldn't replicate the issue. It working fine in all browser at my end.

    Thanks,
    Princy.
  8. Rob
    Rob avatar
    23 posts
    Member since:
    Apr 2013

    Posted 10 Sep 2013 Link to this post

    Hi, Princy,

    My Tree View inside of Rad Splitter. After changing text, text box doesn't change back to link.
  9. Rob
    Rob avatar
    23 posts
    Member since:
    Apr 2013

    Posted 11 Sep 2013 Link to this post

    I set AllowNodeEditing="false" . Now it works.

    Thank you for your help.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017