colReorder error with hidden columns in colspan

colReorder error with hidden columns in colspan

xenarxenar Posts: 8Questions: 0Answers: 0

Hello

The first line in the header with colspan and rowspan
There is a group of columns united by the colspan attribute
Using colVis we leave only one column visible in this group. Then we try to move this group to another position.
We get an error in colReorder.

Here's an example.
https://live.datatables.net/yeratibo/4/edit

Replies

  • kthorngrenkthorngren Posts: 20,425Questions: 26Answers: 4,794

    Sounds like the same issue described in this thread. The next version of ColReorder should have the fix or you can try the nightly version.

    Kevin

  • xenarxenar Posts: 8Questions: 0Answers: 0

    No, that's another mistake. That bug was closed.
    Night version didn't help

  • kthorngrenkthorngren Posts: 20,425Questions: 26Answers: 4,794

    Your test case doesn't have the ColReorder library being loaded. I added ColReorder 2.0.1 and see this error:

    Uncaught TypeError: Cannot set properties of undefined (setting '0')

    https://live.datatables.net/yeratibo/5/edit

    Is this the error you are getting?

    I updated to ColReorder 2.0.2 and the error is gone:
    https://live.datatables.net/gatefabe/1/edit

    If you still have the error with 3.0.2 then please provide the steps to recreate the error.

    Kevin

  • xenarxenar Posts: 8Questions: 0Answers: 0
    edited May 15

    Ок
    In your example https://live.datatables.net/gatefabe/1/edit make invisible the Position and Office columns.
    Try dragging the resulting column and you will get an error

    Uncaught TypeError: dz is undefined

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Agreed - many thanks for the test case. I'll take a look into it as soon as I get a chance to.

    Allan

  • kthorngrenkthorngren Posts: 20,425Questions: 26Answers: 4,794

    Try dragging the resulting column and you will get an error

    I tried that and did not see any errors. However if Allan is able to recreate the issue then thats all that matters :smile:

    Kevin

  • xenarxenar Posts: 8Questions: 0Answers: 0




  • kthorngrenkthorngren Posts: 20,425Questions: 26Answers: 4,794

    I see moving the top header causes the error. I see this error in the test case when moving the top header:

    dataTables.colReorder.js:708 Uncaught TypeError: Cannot read properties of undefined (reading 'left')

    Kevin

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    I've committed a fix to address this error. The issue occurred when the first column in a colspan group was hidden, since I had assumed that index 0 would be available and visible.

    It will be in the nightly shortly and in the release I'll make for ColReorder at the end of next week.

    Allan

Sign In or Register to comment.