Destroy method now clears cache & pager rows copy

This commit is contained in:
Mottie 2014-04-10 20:16:22 -05:00
parent 8f88f72899
commit 284b73eaf1
3 changed files with 3 additions and 0 deletions

View File

@ -594,6 +594,7 @@
p.$container.hide(); // hide pager p.$container.hide(); // hide pager
table.config.appender = null; // remove pager appender function table.config.appender = null; // remove pager appender function
p.initialized = false; p.initialized = false;
delete table.config.rowsCopy;
$(table).unbind('destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager'); $(table).unbind('destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager');
if (ts.storage) { if (ts.storage) {
ts.storage(table, p.storageKey, ''); ts.storage(table, p.storageKey, '');

View File

@ -1186,6 +1186,7 @@
$t.toggleClass(ts.css.table + ' ' + c.tableClass + ' tablesorter-' + c.theme, removeClasses === false); $t.toggleClass(ts.css.table + ' ' + c.tableClass + ' tablesorter-' + c.theme, removeClasses === false);
// clear flag in case the plugin is initialized again // clear flag in case the plugin is initialized again
table.hasInitialized = false; table.hasInitialized = false;
delete table.config.cache;
if (typeof callback === 'function') { if (typeof callback === 'function') {
callback(table); callback(table);
} }

View File

@ -785,6 +785,7 @@ tsp = ts.pager = {
p.$container.hide(); // hide pager p.$container.hide(); // hide pager
c.appender = null; // remove pager appender function c.appender = null; // remove pager appender function
p.initialized = false; p.initialized = false;
delete table.config.rowsCopy;
c.$table.unbind('destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager'); c.$table.unbind('destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager');
if (ts.storage) { if (ts.storage) {
ts.storage(table, c.widgetOptions.pager_storageKey, ''); ts.storage(table, c.widgetOptions.pager_storageKey, '');