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

How to return focus to Grid cell after it was edited in popup window?

1 Answer 162 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kudryk
Top achievements
Rank 1
Kudryk asked on 25 Jun 2015, 10:04 AM
I configured custom editor for grid field, it displays popup window to set some params, after popup window is closed grid lose focus. How to restore focus on edited cell ?

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 29 Jun 2015, 07:23 AM
Hi Kudryk,

Here is how to achieve the desired behavior:

1) Use the edit event of the Grid to save the edit container (cell or row, depending on the editing model)

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-edit

2) In the edit event handler, attach a dataBound handler for the Grid, which will be executed only once.

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-dataBound
 
http://docs.telerik.com/kendo-ui/basics/events-and-methods#bind-to-events-after-widget-initialization

3) In the dataBound handler, focus the previously saved container with the Grid's current() method.

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-current

The dataBound handler will be executed when editing is finished.

Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Kudryk
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or