OnClientNodeEditStart
The OnClientNodeEditStart client-side event is called as the edit begins. This event can not be canceled.
You can use this event to set any properties of the input area of the edited node.
The event handler receives parameters:
-
The TreeView instance that fired the event.
-
Event arguments with functions:
-
get_node() retrieves a reference to the node being edited.
-
You can call get_text() from this node reference to get the "old" text prior to editing.
-
You can call get_inputElement() from this node reference to get the INPUT area of the edited node
- get_domEvent() retrieves a DOM event object of the node edit.
The example below uses the OnClientNodeEditStart event to change the text displayed in the INPUT area.
We will achieve the following: when you edit a node like Drafts (2) you will not see the (2) in the INPUT area, but only the real text like below. We will use the OnClientNodeEdited event to restore the number (2) to the original text upon saving.
<telerik:RadTreeView RenderMode="Lightweight" ID="RadTreeView1"
OnClientNodeEditStart="OnClientNodeEditStartHandler"
OnClientNodeEdited="OnClientNodeEditedHandler"
Skin="Office2007"
AllowNodeEditing="true"
runat="server">
...
</telerik:RadTreeView>
This event is available in all versions after Q3 SP2 2008 release.