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

Destroy(remote) - sending IDs

3 Answers 210 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Curt Rabon
Top achievements
Rank 1
Veteran
Curt Rabon asked on 11 Jun 2015, 07:49 PM

In the following documentation page: docs.telerik.com/kendo-ui/framework/datasource/crud

you state: "The destroy action submits the data item(s) that should be deleted, or just its ID(s)."

Please explain how we can choose to send just the ID(s) and not the data-items (models).  If it's a config setting, then please tell me where it should be set.  If it has to be done manually by me, please give an example.

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 15 Jun 2015, 01:30 PM

Hello Curt Rabon,

The parameterMap function is responsible for sending data to the server-side. So you can modify the paremeterMap option and send only the information that you need. Here is the relevant documentation article:

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-transport.parameterMap

Regards,

Kiril Nikolov

Telerik

 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Curt Rabon
Top achievements
Rank 1
Veteran
answered on 15 Jun 2015, 02:43 PM

Yes, I'm very familiar with the parameterMap feature, and I already know how to use that to send just the IDs when the "operation" argument to that function == "destroy".

 However, I'm using the MVC wrappers, and FOR THE GRID, it looks like you do some special things in this parameterMap function for the "read" operation, when server-side filtering is used.  For example, when the grid is using server-operations and a filter is applied to a column, it seems you put the filtering parameters in a special format before sending to the server. Even though I'm using the MVC wrappers, I can still wire-up the parameterMap feature using JavaScript. I did this for ONLY the "destroy" operation (for sending my IDs), but then the "read" operation no longer works when filtering, because my use of parameterMap overwrites what you are doing for "read".

If using the MVC wrappers and using server-side operation for the grid, can I still use the parameterMap feature for only "destroy", and not interfere with what you do with "read" ??

0
Kiril Nikolov
Telerik team
answered on 17 Jun 2015, 01:17 PM
Hello,

With the MVC wrappers you can set parameters for every action separately using the .Data extension. The same approach is explained here:

http://www.telerik.com/forums/pass-additional-parameters-to-read-ajax-datasource-method---mvc

Regards,
Kiril Nikolov
Telerik
 
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
Curt Rabon
Top achievements
Rank 1
Veteran
Answers by
Kiril Nikolov
Telerik team
Curt Rabon
Top achievements
Rank 1
Veteran
Share this question
or