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

Add Items to KendoDataSource does not trigger the transport create function

3 Answers 459 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Anil
Top achievements
Rank 1
Anil asked on 03 May 2013, 04:16 PM
Using KendoDataSource's "add" method adds to the local view model object and does not call the transport create method. Is there a version of the add method that calls the create method defined in transport (in my case my code is similar to the aspnet-crud example project in kendo grid). I would want my controller method called on kendodatasource add. Please advise

3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 06 May 2013, 06:39 AM
Hello Anil,

If I understand your requirement correctly you need to  configure autoSync or call sync right after add.

Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Anil
Top achievements
Rank 1
answered on 06 May 2013, 08:27 PM
Hello Nikolay,  Thank you the autosync works and calls the server side code (controller). However after calling the server it does not not update the view model again, i have to call read on the kendodatasource object. Is there anyway for it to auto refresh the data source

Thanks,
Anil
0
Accepted
Nikolay Rusev
Telerik team
answered on 07 May 2013, 08:01 AM
Hello Anil,

You will have to return the newly created item in order to be accepted from the DataSource. For example see what is the response in the browser console in Grid editing demo when you insert new record.

You can also see variations on server side implementation in the following code library applications:
https://github.com/telerik/kendo-examples-asp-net/tree/master/grid-web-service-crud
https://github.com/telerik/kendo-examples-asp-net-mvc/tree/master/grid-crud

Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Anil
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Anil
Top achievements
Rank 1
Share this question
or