External form editing for current item

3 posts, 0 answers
  1. Marcin
    Marcin avatar
    31 posts
    Member since:
    Jul 2013

    Posted 07 Mar 2016 Link to this post

    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. Marcin
    Marcin avatar
    31 posts
    Member since:
    Jul 2013

    Posted 07 Mar 2016 in reply to Marcin Link to this post

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

     

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

  3. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 09 Mar 2016 Link to this post

    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!
     
Back to Top