colReorder error with rowspan and colspan

colReorder error with rowspan and colspan

xenarxenar Posts: 8Questions: 0Answers: 0

HI.

When combining the rowspan and colspan attributes in the first row of the header, an error occurs when dragging columns. Here's an example.
Here's an example. https://live.datatables.net/serobepo/1/edit

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Looks like it doesn't need ColReorder for the error to happen: https://live.datatables.net/serobepo/1/edit .

    Thanks for letting me know about this and the error. I'll post back when I've got a fix.

    Allan

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    I was just starting to look at this and realised that the HTML in the header is invalid:

            <thead>
              <tr>
                <th rowspan="2">Name</th>
                <th colspan="5">Group</th>           
                
              </tr>
                <th>Position</th>
                
                <th>Office</th>
                <th>Age</th>
                <th>Start date</th>
                <th>Salary</th>
               <tr>
                 
               </tr>
              
            </thead>
    

    It should be:

            <thead>
              <tr>
                <th rowspan="2">Name</th>
                <th colspan="5">Group</th>
              </tr>
               <tr>
                <th>Position</th>
                <th>Office</th>
                <th>Age</th>
                <th>Start date</th>
                <th>Salary</th>
               </tr>
            </thead>
    

    With that corrected DataTables core works just fine, but ColReorder is still throwing an error.

    Looking into it, but glad it isn't as serious as I thought!

    Allan

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Fix committed to ColReorder. It will be in the nightly build shortly and in the next release :)

    Thanks for letting me know about this error!

    Allan

  • xenarxenar Posts: 8Questions: 0Answers: 0

    Yes. I received this error in my project and was careless when I described it in https://live.datatables.net/

    Thank you.

Sign In or Register to comment.