colVis + colReorder + stateSave

colVis + colReorder + stateSave

gduvalgduval Posts: 6Questions: 3Answers: 0

Hello,
Have you found a compatibility solution between colVis, colReorder and stateSave?
Here's an example of the issue:
Initial load:

3 columns: '1', '2', '3'

User actions:

Reorder: '1', '3', '2'
Hide column '3': '1', '2'

After reload:

Displayed columns: '1', '3' (instead of '1', '2')

The saved state doesn't correctly restore the combination of reordering + visibility.
Best regards,

Answers

  • rf1234rf1234 Posts: 3,177Questions: 92Answers: 438

    Just tested it with my own data tables application - and it worked perfectly fine. The reordered columns were in the right place and the hidden column was still the correct one.

    Can you post a test case please highlighting the issue.

  • gduvalgduval Posts: 6Questions: 3Answers: 0

    Hello,

    Test case: https://live.datatables.net/gigegefu/2/
    Steps to reproduce:

    Initial state

    Order: "Name", "Position", "Office", "Age", "Start date", "Salary"
    → Save as "State 1"

    Swap two columns

    Move "Position" and "Office" to get: "Name", "Office", "Position", "Age", "Start date", "Salary"
    → Save as "State 2"

    Hide a column

    Hide "Office" to get: "Name", "Position", "Age", "Start date", "Salary"
    → Save as "State 3"

    Test state restoration

    Load "State 1" → ✓ OK: "Name", "Position", "Office", "Age", "Start date", "Salary"
    Load "State 3" → ❌ ISSUE: "Name", "Office", "Age", "Start date", "Salary"
    Load "State 2" → ✓ OK: "Name", "Office", "Position", "Age", "Start date", "Salary"
    Load "State 3" → ✓ OK: "Name", "Position", "Age", "Start date", "Salary"

    Expected result: When first loading "State 3", the order should be "Name", "Position", "Age", "Start date", "Salary"
    Actual result: The "Office" column appears in place of "Position"

Sign In or Register to comment.