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

Add New Record - not working when webservice returns empty array

2 Answers 262 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Henri
Top achievements
Rank 1
Henri asked on 23 Jan 2019, 01:38 PM

Dear Telerik,

 

I have a problem with the 'Add New Record'-Functionality.
When my Webservice is returning an empty array I cannot add a new record with the 'Add New Record'-button.
The empty row appears for a brief period of time(less than 1 second) and disappears again.

The Problem does not occur when get a filled array from the webservice.

Can you please help me ?

 

Henri

2 Answers, 1 is accepted

Sort by
0
Henri
Top achievements
Rank 1
answered on 23 Jan 2019, 02:17 PM
http://jsfiddle.net/0dyxe3su/3/    Add new record is working with data
http://jsfiddle.net/0dyxe3su/4/    Add new record is not  working without data (data:[])
0
Accepted
Tsvetina
Telerik team
answered on 25 Jan 2019, 07:21 AM
Hello Henri,

The Grid in the jsfiddle is not fully configured for editing. It is missing:

1. Id field in the schema.model definition (required for editing)
2. Editing is actually not enabled. The editable field needs to be set to some value.
3. batch: true setting in the DataSource is required if "incell" editing mode is to be used.

Also, the jsfiddle is using a very old version of Kendo UI (2011.3.1129). Editing still fails with this version after the adjustments, but when I test with latest, it works as expected:
https://dojo.telerik.com/eNagOWur

Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Henri
Top achievements
Rank 1
Answers by
Henri
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or