Unstable grouping sorting algorithm?

5 posts, 0 answers
  1. Marcel
    Marcel avatar
    3 posts
    Member since:
    Sep 2017

    Posted 18 Oct 2017 Link to this post

    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.

     

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 19 Oct 2017 Link to this post

    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.
  3. Marcel
    Marcel avatar
    3 posts
    Member since:
    Sep 2017

    Posted 19 Oct 2017 in reply to Konstantin Dikov Link to this post

    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. ;(

  4. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 19 Oct 2017 Link to this post

    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.
  5. Marcel
    Marcel avatar
    3 posts
    Member since:
    Sep 2017

    Posted 23 Oct 2017 in reply to Konstantin Dikov Link to this post

    Thank you, this solved the problem. xD

     

    With best wishes

    Marcel

Back to Top