Destroy(remote) - sending IDs

4 posts, 0 answers
  1. Curt Rabon
    Curt Rabon avatar
    45 posts
    Member since:
    Dec 2008

    Posted 11 Jun 2015 Link to this post

    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.

  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 15 Jun 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Curt Rabon
    Curt Rabon avatar
    45 posts
    Member since:
    Dec 2008

    Posted 15 Jun 2015 in reply to Kiril Nikolov Link to this post

    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" ??

  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 17 Jun 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready