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

Kendo Grid - Server side sorting with Automapper

1 Answer 263 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Miguel Angel
Top achievements
Rank 1
Miguel Angel asked on 14 Apr 2016, 03:02 PM

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

 

 

 

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 19 Apr 2016, 07:02 AM

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!
 
Tags
Grid
Asked by
Miguel Angel
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or