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

create fire multiple request

6 Answers 221 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Backe
Top achievements
Rank 2
Backe asked on 20 Jun 2013, 05:27 AM
Hello!

I have a problem while creating  more than one object in a grid. Creating the first object is okay. But when I save the second object it send the request to the server and saves it (it returns a json object with the required ID) but a second request with previous data is fired too. How can i avoid that?

The "batch" flag in DataSource is set to false.
(Version: Kendo UI Complete v2013.1.614)

Thank you in advance.

Jörg Bergner

6 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 20 Jun 2013, 06:12 AM
Hello Jörg,

I assume that the problem is connected with IDs of the records. Please make sure that the ID of the model is set correctly and that each existing (saved) record has a unique ID value. For more information on the subject check this forum thread.

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Backe
Top achievements
Rank 2
answered on 20 Jun 2013, 06:28 AM
Hello Alexander!

Thank you for your fast reply!

Creating a second object in the grid fires two requests. The first one returns with a new unique ID. The second request (I don't know where it comes from) tries to save the previous created object again. The server returns with an error, because that would be an duplicate. If I switch off that error and return the object, I can proceed with creating new objects. At the third creation kendo fires three request. And so on ...

Regards,
Jörg Bergner
0
Alexander Valchev
Telerik team
answered on 21 Jun 2013, 03:16 PM
Hello Jörg,

I was not able to reproduce the same behaviour in this on-line demo. Is it possible for you to provide a small but runnable project with mock data which demonstrates the issue? In this way I would be able to examine your configuration and the network requests in details and provide you with a concrete recommendations.
Thank you in advance for the cooperation.

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Backe
Top achievements
Rank 2
answered on 24 Jun 2013, 05:21 AM
Hello Alexander!

It is hard to reproduce the error in a public working example (still trying that). I think there is a problem between my services and kendo. What i figured out is, that imho the flag "batch" set to false doesn't work as expected. If I switch the flag to "true" and adapt all my services it works.
0
Alexander Valchev
Telerik team
answered on 25 Jun 2013, 03:20 PM
Hi Jörg,

I am afraid we cannot be of much help without having a better look over your exact setup. Please send us a sample project so we can reproduce the issue locally and I will do my best to help you resolve it.

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Zachary
Top achievements
Rank 1
answered on 12 Dec 2013, 02:36 AM
I was experiencing the multiple-create issue as well. To resolve it, I modified my [HttpPost] Web API method to return the full record in JSON format. Previously, I had just been returning the ID as an integer.
Tags
Grid
Asked by
Backe
Top achievements
Rank 2
Answers by
Alexander Valchev
Telerik team
Backe
Top achievements
Rank 2
Zachary
Top achievements
Rank 1
Share this question
or