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

[Solved] Handle actions in JS before going into delete or edit mode

3 Answers 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michiel
Top achievements
Rank 1
Michiel asked on 23 Feb 2011, 12:58 PM
What is the best way to handle an action before going into edit mode or delete an item?

We have a situation that we need to request a lock before doing an edit action. In the OnEdit event I can cancel the edit and do an ajax call to request the lock. When I want to put the row into edit mode again, I can only use the EditRow function, which will trigger the event again.

What I actually need is an OnBeforeEdit function with the ability to cancel the action. The same for the delete functionality.

Is it possible to have these type of events or is there a better way to do it?

I can use custom buttons, but if I have events like OnBeforeEdit I can create much cleaner code.

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 23 Feb 2011, 04:49 PM
Hello Michiel,

 There is no such event for the time being. I am afraid that I cannot suggest any workaround apart from raising a flag whether the lock has been made already when handling the OnEdit event.

Regards,
Atanas Korchev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Michiel
Top achievements
Rank 1
answered on 23 Feb 2011, 04:53 PM
Thanks for the response. 

Is it possible to include this functionality in a next release? Be able to do certain checks (locking, security etc) before actually going into edit mode can be a good addition to this already good grid.

I now have a solution in which the OnEdit hides the edit controls, performs an ajax call to set the lock and regarding the outcome shows the controls or performs a grid.cancel. While this works, it is better to not start the edit mode if not needed/allowed.

Please consider it for a next version.
0
Atanas Korchev
Telerik team
answered on 23 Feb 2011, 04:55 PM
Hello Michiel,

I will log this for further consideration by the development team. I have also updated your Telerik points.

Regards,
Atanas Korchev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Grid
Asked by
Michiel
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Michiel
Top achievements
Rank 1
Share this question
or