Core & pager: use detach instead of empty on tbody rows

This commit is contained in:
Mottie 2014-05-08 12:07:13 -05:00
parent acefd269f9
commit 9c0017d44e
3 changed files with 5 additions and 5 deletions

View File

@ -289,7 +289,7 @@
exception === 'timeout' ? 'Time out error' : exception === 'timeout' ? 'Time out error' :
exception === 'abort' ? 'Ajax Request aborted' : exception === 'abort' ? 'Ajax Request aborted' :
'Uncaught error: ' + xhr.statusText + ' [' + xhr.status + ']' ); 'Uncaught error: ' + xhr.statusText + ' [' + xhr.status + ']' );
c.$tbodies.eq(0).empty(); c.$tbodies.eq(0).detach();
p.totalRows = 0; p.totalRows = 0;
} else { } else {
// process ajax object // process ajax object
@ -311,7 +311,7 @@
if (d instanceof jQuery) { if (d instanceof jQuery) {
if (p.processAjaxOnInit) { if (p.processAjaxOnInit) {
// append jQuery object // append jQuery object
c.$tbodies.eq(0).empty().append(d); c.$tbodies.eq(0).detach().append(d);
} }
} else if (l) { } else if (l) {
// build table from array // build table from array

View File

@ -1136,7 +1136,7 @@
}; };
ts.clearTableBody = function(table) { ts.clearTableBody = function(table) {
$(table)[0].config.$tbodies.empty(); $(table)[0].config.$tbodies.detach();
}; };
ts.bindEvents = function(table, $headers, core){ ts.bindEvents = function(table, $headers, core){

View File

@ -486,7 +486,7 @@ tsp = ts.pager = {
ts.log('Ajax Error', xhr, exception); ts.log('Ajax Error', xhr, exception);
} }
ts.showError(table, exception.message + ' (' + xhr.status + ')'); ts.showError(table, exception.message + ' (' + xhr.status + ')');
c.$tbodies.eq(0).empty(); c.$tbodies.eq(0).detach();
p.totalRows = 0; p.totalRows = 0;
} else { } else {
// process ajax object // process ajax object
@ -508,7 +508,7 @@ tsp = ts.pager = {
if (d instanceof jQuery) { if (d instanceof jQuery) {
if (wo.pager_processAjaxOnInit) { if (wo.pager_processAjaxOnInit) {
// append jQuery object // append jQuery object
c.$tbodies.eq(0).empty().append(d); c.$tbodies.eq(0).detach().append(d);
} }
} else if (l) { } else if (l) {
// build table from array // build table from array