mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Allow for optional output callback in favour of parsable string
This commit is contained in:
parent
daa7cfa89c
commit
44f6a4771f
@ -182,6 +182,11 @@
|
||||
p.startRow = (t) ? sz * p.page + 1 : (p.filteredRows === 0 ? 0 : sz * p.page + 1);
|
||||
p.endRow = Math.min( p.filteredRows, p.totalRows, sz * ( p.page + 1 ) );
|
||||
$out = p.$container.find(p.cssPageDisplay);
|
||||
|
||||
// Output param can be callback for custom rendering or string
|
||||
if (typeof p.output === 'function') {
|
||||
s = p.output(table, p);
|
||||
} else {
|
||||
// form the output string (can now get a new output string from the server)
|
||||
s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || p.output : p.output )
|
||||
// {page} = one-based index; {page+#} = zero based index +/- value
|
||||
@ -203,6 +208,7 @@
|
||||
}
|
||||
return extra.length > 1 && data && data[extra[0]] ? data[extra[0]][extra[1]] : p[str] || (data ? data[str] : deflt) || deflt;
|
||||
});
|
||||
}
|
||||
if ( p.$goto.length ) {
|
||||
t = '';
|
||||
options = buildPageSelect( table, p );
|
||||
|
Loading…
Reference in New Issue
Block a user