Rows Grouping is broken when sorting rows ( if some columns of the datatable are hidden)

Rows Grouping is broken when sorting rows ( if some columns of the datatable are hidden)

rbcarbca Posts: 4Questions: 2Answers: 0
edited June 2017 in Free community support

Hello,
I am working with datatables 1.10 and using rows grouping option.
In fact, the row grouping depends on the values that exist on the columns by displaying: column name: value.
The feature works fine when all columns are displayed (rows grouping maintains the good values when performing sorting in rows).
But when I hide some columns of my datatable (using ColVis option) and apply the sorting of my data in any column of the grid, the grouping values are changed by taking values from other columns.

For example:
When displaying the grid with the following columns (the grid contains many other columns which are hidden), the Grouping of rows works fine: it groups by the values of Urgency column

ID Title Urgency Number
Urgency: * None *
1 TEST 1 * None * 60000
2 TEST 2 * None * 65485
Urgency: High/Yes
3 TEST 3 High/Yes 60045
4 TEST 4 High/Yes 65455
Urgency: Low/No
5 TEST 5 Low/No 70000
6 TEST 6 Low/No 67775

Once I sort the grid by any column (ID or Title or Urgency or Number), the rows grouping is broken and takes the following values:

ID Title Urgency Number
Urgency: Resolved
6 TEST 6 Low/No 67775
5 TEST 5 Low/No 70000
Urgency: in progress
4 TEST 4 High/Yes 65455
2 TEST 2 * None * 65485
Urgency: Opened
3 TEST 3 High/Yes 60045
1 TEST 1 * None * 60000

In fact when I sort by Title Column , the grouping takes values of a hidden column called Status (Resolved, in progress, Opened).

Any Idea ?

Answers

  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin

    Can you provide a link to a test case showing the issue please?

    Allan

  • rbcarbca Posts: 4Questions: 2Answers: 0

    Hello,
    I had the application in my local.
    in fact I will explain to you the problem by screenshots as below:
    1- Here is the grid when adding the grouping element (in this case Urgency (current)) and without hiding any column:

    2- When I sort by any column of my grid, Everything is OK, and the values grouped by are still correct (After each refresh of the datatable):

    3- Now I will hide some columns, as below and refresh my datatable:
    Before refreshing:

    After refreshing:

    The grouping values of Urgency (current) are changed.

    Thank you.

  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin

    I'm afraid to say that I really don't know what would cause that. I would need a test page showing the issue so I can debug it.

    JSFiddle or http://live.datatables.net can be used to create a test case if you can't link to your app.

    Thanks,
    Allan

  • rbcarbca Posts: 4Questions: 2Answers: 0
    edited June 2017

    Hello,

    I couldn't regenerate the same structure of datatable as I had, is a video showing you the debug information and a live demo will be sufficient for you to more understand the issue ?

    Many thanks.

  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin

    Probably. That would be worth a go anyway :).

    Thanks,
    Allan

This discussion has been closed.