problem with colspan in rowgroup after update from v2.1.4 to 2.1.5

problem with colspan in rowgroup after update from v2.1.4 to 2.1.5

MelodyNelsonMelodyNelson Posts: 213Questions: 33Answers: 2
edited September 3 in Free community support

Link to test case: https://live.datatables.net/siyeduge/5/edit
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Hi,

I have just updated my version from 2.1.4 to 2.1.5 and on this page, each td of the rowgroup rowshave a collspan equal to the total tdof the table even if I have define the colspan in the DT js.

The result on the website (private, I can't share a link) with the 2.1.5 version :

Before the update :

I have made a test case to show you what's happening.
Also, on the test case, the last row with the global total is not showing, I don't know why.
On my page/screen capture it's the last row in blue.

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

Should I change something since the update ?

Thank you

Answers

  • allanallan Posts: 63,352Questions: 1Answers: 10,443 Site admin

    Using DataTables 2.1.4 doesn't show any difference for me? Both have a colspan of 19 for the row grouping rows. Am I looking at the right thing?

    Allan

  • MelodyNelsonMelodyNelson Posts: 213Questions: 33Answers: 2
    edited September 3

    No, I think you are looking at the starting rowgroup.
    The problem is on the ending rowgroup.

    Do you see the total ?

    In the test case I made, I see the code for the total (result of calculation) but nothing on screen

  • allanallan Posts: 63,352Questions: 1Answers: 10,443 Site admin

    Thanks - yes, I hadn't clicked that was the issue. I see it now with 2.1.5, but I also see it with 2.1.4. Did you update anything else?

    I actually think it might be quite difficult to resolve this issue, since column visibility can change and DataTables doesn't know much about the cells you've put it. If I may suggest, rather than inserting two cells, just insert a single one and use inner elements to align the content it as you need.

    Allan

  • MelodyNelsonMelodyNelson Posts: 213Questions: 33Answers: 2

    I didn't change anything on this page, the only difference is the update from 2.1.4 to 2.1.5.

    Example code generated with the 2.1.5 version : colspan="19" added to all the td

    <tr class="dtrg-group soustotal has-text-FT dtrg-level-1">
    <td colspan="19" class="has-text-dark has-text-right has-text-weight-semibold white-space-nowrap">TOTAL JUILLET 2023</td>
    <td class="has-text-dark has-text-right has-text-weight-semibold white-space-nowrap" colspan="19">15 180,00</td>
    </tr>
    
    <tr class="dtrg-group soustotal has-text-FT dtrg-level-0">
    <td colspan="19" class="has-text-FT has-text-right has-text-weight-semibold white-space-nowrap">TOTAL 2023<br></td>
    <td class="has-text-FT has-text-right white-space-nowrap has-text-weight-semibold" colspan="19">862 723,73<br></td>
    </tr>
    
    

    The same rows with the 2.1.4 version : only the colspan="12"on the first td as written in my js code

    <tr class="dtrg-group soustotal has-text-FT dtrg-level-1">
    <td colspan="12" class="has-text-dark has-text-right has-text-weight-semibold white-space-nowrap">TOTAL JUILLET 2023</td>
    <td class="has-text-dark has-text-right has-text-weight-semibold white-space-nowrap">15 180,00</td>
    </tr>
    
    <tr class="dtrg-group soustotal has-text-FT dtrg-level-0">
    <td colspan="12" class="has-text-FT has-text-right has-text-weight-semibold white-space-nowrap">TOTAL 2023<br></td>
    <td class="has-text-FT has-text-right white-space-nowrap has-text-weight-semibold">862 723,73<br></td>
    </tr>
    

    I wish the rowgrouping worked like the footerCallback, it's easier and the columns always adjust even if some are hidden.

    I will try some changes today.

Sign In or Register to comment.