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

Change Node Text on ClientNodeEditStart

7 Answers 55 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 05 Sep 2013, 03:37 PM
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.

7 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 06 Sep 2013, 06:58 AM
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.
0
Rob
Top achievements
Rank 1
answered on 06 Sep 2013, 10:42 AM
Hi, Princy,

I am not using RadTreeViewContextMenu. I would like to achieve this functionality on double click.
Could you help please.
0
Princy
Top achievements
Rank 1
answered on 09 Sep 2013, 02:51 AM
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.
0
Rob
Top achievements
Rank 1
answered on 09 Sep 2013, 11:09 AM
Hi, Princy,

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

Please help.

0
Princy
Top achievements
Rank 1
answered on 10 Sep 2013, 04:23 AM
Hi Rob,

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

Thanks,
Princy.
0
Rob
Top achievements
Rank 1
answered on 10 Sep 2013, 06:12 PM
Hi, Princy,

My Tree View inside of Rad Splitter. After changing text, text box doesn't change back to link.
0
Rob
Top achievements
Rank 1
answered on 11 Sep 2013, 02:50 PM
I set AllowNodeEditing="false" . Now it works.

Thank you for your help.
Tags
TreeView
Asked by
Rob
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Rob
Top achievements
Rank 1
Share this question
or