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

Unstable grouping sorting algorithm?

4 Answers 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 18 Oct 2017, 06:10 AM

Hello,

i have a question to the server-side grouping option. The grid is configured with server-side sorting and server-side grouping. The column-sorting runs without errors, but as soon as i group the table is the sorted Data (from a sorted column) not sorted anymore.

After that i logged the data from the server and the data is sorted as it should. Furthermore i tried to sort the data directly on the server, and then i grouped the grid two times (no column sorting in the grid). The result was that the server-sorted column was not sorted anymore. With this test is clear that the grid is sorting the incoming (already sorted) data. Does somebody has any idea how i can fix that issue.

I attached two files with the grid and the server data. The blue rectangle marks the relevant part and the red one the sorted column.

 

4 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 19 Oct 2017, 07:17 AM
Hi Marcel,

Could you please share the configuration of your Grid, so we can see if there is something wrong with it. You could also try to set all data operations to be handled on server-side, because mixing server with client-side operation is not recommended.

Looking forward to your reply.


Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Marcel
Top achievements
Rank 1
answered on 19 Oct 2017, 08:50 AM

Here is the Code of the Grid:

self.grid = self.contentSelector.kendoGrid({                   
    dataSource : self.dataSource,
    filterable: {
        extra: false,
        operators: {
            string: GRID_FILTER_CONDITIONS
        },
        messages: {
            info: "Filter festlegen:",
        clear: "Löschen",
        filter: "Übernehmen"
         }
    },
    toolbar: toolbarTemplate,
    dataBound : onDataBound,
    columns : self.generateColumnFields(),
    reorderable: true,
    columnReorder: function(e) {
            self.reorderExtraTableColumn(e.oldIndex - 1, e.newIndex - 1);
        },
    resizable: true,
    groupable: true,
    serverGrouping: true,
    group: function(e) {
        self.shiftExtraTableColumns(e.groups);
    },
    sortable: true,
    pageable : true,
    editable : false
}).data("kendoGrid");

 

And this is the DataSource:

return new kendo.data.DataSource({
    transport: {
        read: {
            url: globalRrmURL + url,
            type: 'post',
            dataType: 'json',
            contentType: 'application/json'
        },
        parameterMap: buildRequestObj,
    },
    serverFiltering: true,
    serverPaging: true,
    serverSorting: true,
    pageSize: pageSize || 20,
    schema: {
        type: 'json',
        total: function(response) {
            return response.rowCount;
        },
        data: 'rowMap',
        parse: processServerResponse
    }
});

 

I think that all our data operations are already set to server-side. ;(

0
Konstantin Dikov
Telerik team
answered on 19 Oct 2017, 01:55 PM
Hello Marcel,

The serverGrouping property should be set to the dataSource and I see in the code snippets that it is being set to the Grid directly. Could you please move it to the dataSource and see if this will resolve the problem?

Looking forward to your reply.


Regards,
Konstantin Dikov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Marcel
Top achievements
Rank 1
answered on 23 Oct 2017, 12:08 PM

Thank you, this solved the problem. xD

 

With best wishes

Marcel

Tags
Grid
Asked by
Marcel
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Marcel
Top achievements
Rank 1
Share this question
or