Deleting row footer error

Deleting row footer error

krojewkrojew Posts: 30Questions: 0Answers: 0
edited August 2010 in Bug reports
Hi,
I found a bug when using fnDeleteRow() function. After deletion, the item count in the footer does not get updated.

Replies

  • allanallan Posts: 62,099Questions: 1Answers: 10,183 Site admin
    I've just tried this and it seems to be working okay for me:

    [code]
    $(document).ready(function() {
    $('#example').dataTable();
    setTimeout( function () {
    $('#example').dataTable().fnDeleteRow( $('#example tbody tr:eq(0)')[0] );
    }, 1000 );
    } );
    [/code]
    The information text gets updated on every table draw, and fnDeleteRow does do a draw - unless you have disabled this by passing false as the third parameter.

    Allan
  • krojewkrojew Posts: 30Questions: 0Answers: 0
    That's strange - in my case the footer never gets updated.

    [code]
    departamentTable = $('#departament-table').dataTable({
    bJQueryUI: true,
    sDom: 'T<"clear"><"H"lfr>t<"F"ip>',
    sPaginationType: 'full_numbers',
    oLanguage: {
    sUrl: '/js/i18n/dataTables.pl.txt'
    }
    });
    [/code]

    [code]
    departamentTable.fnDeleteRow($('#departament-table tr.row-selected'));
    [/code]
  • allanallan Posts: 62,099Questions: 1Answers: 10,183 Site admin
    You aren't passing a DOM element - you've giving it a jQuery object. Try:

    [code]
    departamentTable.fnDeleteRow($('#departament-table tr.row-selected')[0]);
    [/code]
    Hopefully that will do the trick.

    Allan
  • krojewkrojew Posts: 30Questions: 0Answers: 0
    That was it. Thank you.
This discussion has been closed.