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

[Solved] Missing cancel event?

4 Answers 176 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Puzsol
Top achievements
Rank 1
Puzsol asked on 16 Jun 2008, 12:15 AM
I have a tree view.
I add a new node, and allow the user to edit it.
The user presses the escape key and cancels the editing.

Problem: There is no event to let me know that the editing was cancelled, so that I can remove the node!

From my testing, it would appear that in this case niether the "OnClientNodeEdited" or "OnClientNodeEditing" events are triggered

Unless I am missing something, there is no other event that would cover this case.

Is there anything I can do, other than set-up a timer to poll for the change in the editing state of the node?

Thanx

Andrew

4 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 18 Jun 2008, 12:12 PM
Hello Puzsol,

Currently RadTreeView does not offer such an event but you could use the 'timer' approach as you described it.

Nevertheless I consulted with our developers and they will consider the implementation of an event, which will fire when the editing of a Node ends, in future versions of RadTreeView.

Regards,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jason
Top achievements
Rank 2
answered on 03 Feb 2010, 11:39 AM
Hi,

I have a similar problem with users pressing the escape key and would like to capture the user cancelling the node edit. 

My scenario is that when a new node is created I immediately put it into edit mode and the user then names the new node.  Then I postback and update the backend database.  My Ajax onResponseEnd code then updates the new nodes value with the databases record id.  This in turn then enables my nodeclick, nodedelete and context menu events etc...

I can code my nodeclick and nodedelete events etc... to check for a valid database value and react accordingly but it would be far simpler to have a user cancel node editing event.

Is there any update on this post?

Thanks
Jase

0
Schlurk
Top achievements
Rank 2
answered on 03 Feb 2010, 01:35 PM
Have you tried to look into the OnClientKeyPressing event to see if you can subscribe to it and check for the Escape key being pressed and do whatever logic you might want to do in this event?
0
Jason
Top achievements
Rank 2
answered on 04 Feb 2010, 03:09 PM
Hi,

Yes, I have tried the onkeypress but it doesn't fire when the escape key is pressed.  I've handled this in the client nodeclicking event and check if the node being clicked has a valid value (database record id assigned after postback).  If not then I alert the user and remove the offending node. 

Thanks for the input though.

Jason
Tags
TreeView
Asked by
Puzsol
Top achievements
Rank 1
Answers by
Simon
Telerik team
Jason
Top achievements
Rank 2
Schlurk
Top achievements
Rank 2
Share this question
or