pager processAjaxOnInit works with jQuery objects. Fixes #572

This commit is contained in:
Mottie 2014-04-09 07:24:17 -05:00
parent 502130d4a3
commit b8cdca396f
2 changed files with 10 additions and 8 deletions

View File

@ -297,8 +297,10 @@
}
l = d.length;
if (d instanceof jQuery) {
// append jQuery object
c.$tbodies.eq(0).empty().append(d);
if (p.processAjaxOnInit) {
// append jQuery object
c.$tbodies.eq(0).empty().append(d);
}
} else if (l) {
// build table from array
for ( i = 0; i < l; i++ ) {
@ -312,10 +314,9 @@
// add rows to first tbody
if (p.processAjaxOnInit) {
c.$tbodies.eq(0).html( tds );
} else {
p.processAjaxOnInit = true;
}
}
p.processAjaxOnInit = true;
// only add new header text if the length matches
if ( th && th.length === hl ) {
hsh = $t.hasClass('hasStickyHeaders');

View File

@ -486,8 +486,10 @@ tsp = ts.pager = {
}
l = d.length;
if (d instanceof jQuery) {
// append jQuery object
c.$tbodies.eq(0).empty().append(d);
if (wo.pager_processAjaxOnInit) {
// append jQuery object
c.$tbodies.eq(0).empty().append(d);
}
} else if (l) {
// build table from array
for ( i = 0; i < l; i++ ) {
@ -501,10 +503,9 @@ tsp = ts.pager = {
// add rows to first tbody
if (wo.pager_processAjaxOnInit) {
c.$tbodies.eq(0).html( tds );
} else {
wo.pager_processAjaxOnInit = true;
}
}
wo.pager_processAjaxOnInit = true;
// only add new header text if the length matches
if ( th && th.length === hl ) {
hsh = $t.hasClass('hasStickyHeaders');