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

Server-side grouping and function mode read: kendo function convertGroup fail

2 Answers 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Claudio
Top achievements
Rank 2
Bronze
Iron
Iron
Claudio asked on 04 Nov 2015, 01:46 PM

Hi, i'm using a kendo grid for server paging, sorting and filtering and now i would like to add grouping functionality:

I use "function mode" to read data, so dataSource is configured as:

let dataSource: any = {
                batch: true,
                serverPaging: true,
                serverSorting: true,
                serverFiltering: true,
                serverGrouping: true,
                page: 1,
                pageSize: 20,
                transport:
                {
                    read: function (options)
                    {

kendo.data.transports["aspnetmvc-ajax"].fn.options.options = { prefix: '' };
                        let request = kendo.data.transports["aspnetmvc-ajax"].fn.options.parameterMap(options.data, "read", false);

                        thisObject.httpService.GetNodes(request)
                        .then(function (args: IHttpServiceParameters)
                        {
                            options.success(args.data);
                        });
                   }
                },
                schema:
                {
                    data: function (data)
                    {
                        return data.Data;
                    },
                    total: function (data)
                    {
                        return data.Total;
                    },
                    groups: function (data)
                    {
                        return data.Data;
                    },
                    model: model
                }
     }

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 06 Nov 2015, 11:28 AM
Hello Claudio,

Since the dataSource type is not set to "aspnetmvc-ajax", you will need to set the groups function from the "aspnetmvc-ajax" schema in order to avoid the problem:
groups: kendo.data.schemas["aspnetmvc-ajax"].groups
This will also be needed for the aggregates option if you are using server aggregates:
aggregates: kendo.data.schemas["aspnetmvc-ajax"].aggregates


Regards,
Daniel
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Claudio
Top achievements
Rank 2
Bronze
Iron
Iron
answered on 11 Nov 2015, 11:45 AM
Thanks it works!
Tags
Grid
Asked by
Claudio
Top achievements
Rank 2
Bronze
Iron
Iron
Answers by
Daniel
Telerik team
Claudio
Top achievements
Rank 2
Bronze
Iron
Iron
Share this question
or