mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Some public methods now accept the table as a DOM element or jQuery object - see #243
This commit is contained in:
parent
571f724bb1
commit
e9ca100372
@ -852,9 +852,10 @@
|
|||||||
// *** Process table ***
|
// *** Process table ***
|
||||||
// add processing indicator
|
// add processing indicator
|
||||||
ts.isProcessing = function(table, toggle, $ths) {
|
ts.isProcessing = function(table, toggle, $ths) {
|
||||||
var c = table.config,
|
table = $(table);
|
||||||
|
var c = table[0].config,
|
||||||
// default to all headers
|
// default to all headers
|
||||||
$h = $ths || $(table).find('.' + c.cssHeader);
|
$h = $ths || table.find('.' + c.cssHeader);
|
||||||
if (toggle) {
|
if (toggle) {
|
||||||
if (c.sortList.length > 0) {
|
if (c.sortList.length > 0) {
|
||||||
// get headers from the sortList
|
// get headers from the sortList
|
||||||
@ -884,10 +885,11 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
ts.clearTableBody = function(table) {
|
ts.clearTableBody = function(table) {
|
||||||
table.config.$tbodies.empty();
|
$(table)[0].config.$tbodies.empty();
|
||||||
};
|
};
|
||||||
|
|
||||||
ts.destroy = function(table, removeClasses, callback){
|
ts.destroy = function(table, removeClasses, callback){
|
||||||
|
table = $(table)[0];
|
||||||
if (!table.hasInitialized) { return; }
|
if (!table.hasInitialized) { return; }
|
||||||
// remove all widgets
|
// remove all widgets
|
||||||
ts.refreshWidgets(table, true, true);
|
ts.refreshWidgets(table, true, true);
|
||||||
@ -1096,6 +1098,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
ts.applyWidget = function(table, init) {
|
ts.applyWidget = function(table, init) {
|
||||||
|
table = $(table)[0];
|
||||||
var c = table.config,
|
var c = table.config,
|
||||||
wo = c.widgetOptions,
|
wo = c.widgetOptions,
|
||||||
ws = c.widgets.sort().reverse(), // ensure that widgets are always applied in a certain order
|
ws = c.widgets.sort().reverse(), // ensure that widgets are always applied in a certain order
|
||||||
@ -1127,6 +1130,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
ts.refreshWidgets = function(table, doAll, dontapply) {
|
ts.refreshWidgets = function(table, doAll, dontapply) {
|
||||||
|
table = $(table)[0]; // see issue #243
|
||||||
var i, c = table.config,
|
var i, c = table.config,
|
||||||
cw = c.widgets,
|
cw = c.widgets,
|
||||||
w = ts.widgets, l = w.length;
|
w = ts.widgets, l = w.length;
|
||||||
|
Loading…
Reference in New Issue
Block a user