Mottie/tablesorter

Table destroy issue

Closed this issue · 2 comments

Hi

On destroying the table
$(.table).trigger("destroy");

destroy function in the jquery.tablesorter.js is trying to remove the widgets (line:2342)
ts.removeWidget( table, true, false );

removeWidget function is trying to get all the widgets. and calling the remove function on each widget.

the table which i have doesn't have a widget-columnSelector

widgets: ['zebra','cssStickyHeaders','editable','math'],

But it is still trying to remove it and I am getting an error
Uncaught TypeError: Cannot read property '$container' of undefined
ts.addWidget.remove @ widget-columnSelector.js:476
$.tablesorter.removeWidget @ jquery.tablesorter.js:2003
$.tablesorter.destroy @ jquery.tablesorter.js:2342

I am just adding the widget-columnSelector.js into the page but not using it on the table.

Thanks

Thanesh

Hi @kthanesh!

Thanks for reporting this problem, I'll look into it!

Ok, this issue has been fixed and is available in the master branch.