Kendo Grid - Server side sorting with Automapper

2 posts, 0 answers
  1. Miguel Angel
    Miguel Angel avatar
    4 posts
    Member since:
    May 2015

    Posted 14 Apr 2016 Link to this post

    Hello,

    I'm trying to create a kendo grid with pagination, sorting and filtering in server side.

    The grid configuration in client side is:

    $scope.options = {
                    sortable: true,
                    filterable: true,
                pageable: true,
                dataSource: {
                        transport: {
                            read: {
                                url: "api/items",
                                contentType: "application/json",
                                dataType: "json",
                                type: "POST"
                            },
                            parameterMap: function (options) {
                                return kendo.stringify(options);
                            }
                        },
                        schema: {
                            total: "totalItems",
                            data: "items"
                 },
                        serverPaging: true,
                        pageSize: 4,
                        serverSorting: true
                    }
                };

    In server side, I've tried to do the pagination but it doesn't work. I have used Kendo.DynamicLinqThe DataSourceRequest containg (take, skip, sort) is corrected loaded from the request but when the query is executed it returns an error because of AutoMapper conversion from Dto to Model.

    What is the correct way of implementing server side pagination, sorting and filtering for Kendo UI Grid, Web API and Automapper(conversion from dto to model)?

     

     

     

  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2289 posts

    Posted 19 Apr 2016 Link to this post

    Hello Miguel Angel,

    ` Kendo.DynamicLinq` is a community driven project and is not supported by us. As such it might not integrated well with all possible ORM implementations. At the end it provides one possible solution for server operations.

    `What is the correct way of implementing server side pagination, sorting and filtering for Kendo UI Grid, Web API and Automapper(conversion from dto to model)?` - The developer is responsible for handling server operations. The DataSource will send its current state, such as page index, page size, sort/filter etc. descriptors, and the server implementation should operate over that "context" and return processed data.

    Another possible manual handling of server operations is demonstrated in the Apply Custom Ajax Binding article for MVC wrappers.

    Regards,
    Nikolay Rusev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top