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

In Cell Editing, but Inline Editing when adding record

1 Answer 205 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 06 Jan 2017, 10:05 PM

Here's an example of what I'm working with: http://dojo.telerik.com/uYidA/7

I'm making a grid that is using autoSync and in cell editing for updating rows and allowing the rows to be reordered with kendo sortable as well.

The issue I'm running into is whenever you try to add a new record I'm getting this error "Uncaught TypeError: Cannot read property 'closest' of undefined" which is due to autoSync trying to find a row that isn't currently there yet.

What I'm wondering is if there's a way to add a row using the edit/update/delete whenever I'm using batch and in cell editing?

Basically I'm wanting to be able to update rows with in cell editing using autoSync to save as you go, but whenever you add a new record to use inline editing so that I'm not creating a blank record in the database and then updating that blank record?

Let me know if that makes sense! I know it's a little confusing

Thanks!

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 10 Jan 2017, 12:41 PM

Hello Ken,

Indeed at the time when the change event of the Kendo UI DataSource is fired with action "sync" the new row is not available in the grid's table. Maybe a flag should be used in order to determine whether a new row is added to the grid and open the cell in edit from the dataBound event handler for example. 

Regards,
Boyan Dimitrov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Ken
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or