Group Subtotal datatable at the bottom

1

I have a datatable with subtotal. jsfiddle , but this subtotal is at the top and needs to appear at the bottom as subtotal.

Testing I have found that it generates TR when it passes through this line of code

if (last !== group) {
    groupid++;
    $(rows).eq(i).before(
        '<tr class="group"><td>' + group + '</td></tr>'
    );
    last = group;
}

How do I make this TR generate at the end and not at the beginning of each item?

    
asked by anonymous 15.09.2017 / 19:28

1 answer

0

Try this:

if (last !== group) {
    groupid++;
    $(rows).eq(i).parent().append(
        '<tr class="group"><td>' + group + '</td></tr>'
    );
    last = group;
}
    
15.09.2017 / 19:55