• Resolved gatta2

    (@gatta2)


    Hi, I tried to use Jquery to add a row with colspan then the sorting doesn’t working anymore.

    jQuery(document).ready(function($) {
    $(‘#tablepress-12 > tbody >tr:first-child’).after(‘<tr><td colspan=”5″>test</td></tr>’);
    });

    Is there any way to make sorting work with a row containing colspan?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter gatta2

    (@gatta2)

    Actually removing the colspan also make sorting not work. The error is

    Uncaught TypeError: Cannot set property ‘_DT_CellIndex’ of undefined

    Thread Starter gatta2

    (@gatta2)

    Solved by adding the same number of cells as the other rows.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    yes, you will always need to add the correct amount of cells. I’m not sure that this data will be taken into account for the sorting, however.
    Adding a row with colspan is probably not possible here, as the DataTables JS library does not support such tables.

    Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘adding a row with colspan’ is closed to new replies.