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

External form editing for current item

2 Answers 189 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcin
Top achievements
Rank 1
Marcin asked on 07 Mar 2016, 09:47 AM

Hello,

I'm trying to do prepare a application, that allow to edit the grid's data in external form. The only difference to the example shown in: http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/Editing/grid-external-form-editing

is that the edit should work for current item (not selected item), as we want to allow user to select multiply item, but the edit works only in the context of current item.

 

Generally it works, but after changing any value, there is called the dataBound event of the grid, and I can't get to reselect the current item...

In the selection event I do:

this.currentGridItem = e.sender.current();

and in the databound event i try to:

grid.select(itemsToSelect);
                e.sender.current(this.currentGridItem);

 

but the current item does not get selected and the edit context gets lost (selected items are restored correctly).

Can You help with this? This is quite important scenario for us..

Best regards

Marcin Danek

2 Answers, 1 is accepted

Sort by
0
Marcin
Top achievements
Rank 1
answered on 07 Mar 2016, 10:27 AM

Here is a link to example in your's dojo:

 

http://dojo.telerik.com/@Marcin/UvaKu

0
Rosen
Telerik team
answered on 09 Mar 2016, 07:56 AM

Hello Marcin,

In order to implement such behavior you will need to tread the current and selected records separately. Due to the fact that when selecting a record the current will be moved to this row,  you will need to skip the use of select method and highlight the rows manually by adding the appropriate class. Than you could bind the form the the current record.

Here you can find a modified version of the sample which demonstrates a possible implementation.

Regards,
Rosen
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
Marcin
Top achievements
Rank 1
Answers by
Marcin
Top achievements
Rank 1
Rosen
Telerik team
Share this question
or