Kendo Grid Transport with traditional = true param

2 posts, 0 answers
  1. Josh
    Josh avatar
    4 posts
    Member since:
    Feb 2014

    Posted 19 Sep 2014 Link to this post

    I've been trying to figure out how to send a multi-select list back to my MVC controller, what I ended up having to do was pass the traditional: true parameter into the transport.read element. However, this no longer passes the sort parameter. I have re-worked an example here:

    http://dojo.telerik.com/aPAQ/2

    Note that I have commented out type: 'odata', because I am not using odata (no, the grid does NOT load, but I am looking at the request that is built). The key here is to look at the request that is sent in firebug or some other dev util (chrome dev tools). Here is the sort parameter now:

    take:20
    skip:0
    page:1
    pageSize:20
    sort:[object Object]

    Is there a way around this?

  2. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 23 Sep 2014 Link to this post

    Hi Josh,

    Indeed, enabling traditional option will not serialize nested objects as described in this jQuery help article. In order to serialize the data send to the server to the appropriate format when using DataSource with a remote transport, you should use the transport.paramterMap function. For instance you may check this parameterMap implementation, which demonstrates array serialization for ASP.NET MVC default model binder.

    Regards,
    Rosen
    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
Back to Top