How to clear table data

How to clear table data

TonyDevTonyDev Posts: 2Questions: 2Answers: 0
edited June 2015 in Free community support

Hey everyone. I am attempting to make a javascript function that clears the table but I can not seem to get it to work and no errors are getting outputted.

this is my current javascript function

function clearTable(){

var $table = $('#distributorTable');
$.tablesorter.clearTableBody( $table[0] );
$table.trigger('update');

}

Answers

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    This is a forum for the DataTables library. Your code appears to refer to TableSorter, not DataTables.

    In DataTables the clear function is simply clear().

    Allan

This discussion has been closed.