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

Server side Grouping, sorting, and filtering

3 Answers 689 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 16 Jul 2015, 05:06 PM

We are using a kendo ui grid to display some data and have had some issues with datasets over 1000 rows.  I built a web service and enabled server side paging which improved the initial load time.  But, now the grid is very sluggish when grouping, so I am attempting to enable server side grouping.  In addition, I am looking at sorting and filtering on the server in an attempt to improve performance.

What I am struggling with is determining what is being passed to the WCF service from the kendo ui grid for grouping, sorting, and filtering.

So far we have a method prototype of public RetObj GetData(int skip, int take, int page, int pageSize).

I know I will have to add parameters to handle the grouping, sorting, and filtering, but how do I determine what parameters to add?


3 Answers, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 20 Jul 2015, 02:05 PM
Hello,

Indeed you have to add additional parameters to handle the sorting, filtering and grouping. The request to the service will be handled by the kendoDataSource widget which serves as the dataSource of the grid. It has an option called paremeterMap where you can configure any kind of custom parameters passed to the service. You choose the name and the format of the parameters. Then when the service method is called you can perform these operations and return the sorted and filtered data.

var grid1 = $("#grid1").kendoGrid({
        dataSource: {
            transport: {
                read: "http://service url"
            },
            parameterMap: function (data, type) {
                if (type == "read") {
                    return {
                        myFilterParam: ... filter expression ...,
                        mySortParam: ... sort expression ...
                    }
                }
            }
 
        },
        scrollable: true,
        filterable: true,
        columns: [...]
    }).data("kendoGrid");


Regards,
Marin
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Matt
Top achievements
Rank 1
answered on 20 Jul 2015, 02:23 PM
Is there an option for server side grouping as well?
0
Marin
Telerik team
answered on 21 Jul 2015, 07:21 AM
Hi,

Yes, all server side operations are performed in the same.
You can enable serverGrouping in the data source in the same as way you do with filtering and sorting
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-serverGrouping


Regards,
Marin
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
Matt
Top achievements
Rank 1
Answers by
Marin
Telerik team
Matt
Top achievements
Rank 1
Share this question
or