mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Complete merge & cleanup #434
This commit is contained in:
parent
f40e009347
commit
79bc1be5a5
@ -278,12 +278,8 @@
|
||||
for ( i = 0; i < l; i++ ) {
|
||||
tds += '<tr>';
|
||||
for ( j = 0; j < d[i].length; j++ ) {
|
||||
// build tbody cells
|
||||
var temp = $("<td>").html(d[i][j]);
|
||||
var inner = temp.find("td");
|
||||
temp = inner.length ? inner : temp.wrap("<div>").parent();
|
||||
|
||||
tds += temp.wrap("<div>").parent().html();
|
||||
// build tbody cells; watch for data containing HTML markup - see #434
|
||||
tds += /^\s*\<td/.test(d[i][j]) ? $.trim(d[i][j]) : '<td>' + d[i][j] + '</td>';
|
||||
}
|
||||
tds += '</tr>';
|
||||
}
|
||||
|
@ -2734,7 +2734,7 @@ $.extend($.tablesorter.themes.jui, {
|
||||
<td>Function</td>
|
||||
<td>null</td>
|
||||
<td>
|
||||
This function is required to return the ajax data obtained from your server into a useable format for tablesorter to apply to the table (v2.1, <span class="version updated">v2.10</span>).
|
||||
This function is required to return the ajax data obtained from your server into a useable format for tablesorter to apply to the table (v2.1, <span class="version updated">v2.14.3</span>).
|
||||
<div class="collapsible">
|
||||
<br>
|
||||
In <span class="version">v2.10</span>, the returned rows is now optional. And it can either be an array of arrays or a jQuery object (not attached to the table)
|
||||
@ -2753,7 +2753,8 @@ $.extend($.tablesorter.themes.jui, {
|
||||
[ "rowNcell1", "rowNcell2", ... "rowNcellN" ]
|
||||
],
|
||||
[ "header1", "header2", ... "headerN" ] // optional
|
||||
]</pre>Here is some example JSON (comments added, but not allowed in JSON) which is contained in the <a href="https://github.com/Mottie/tablesorter/blob/master/docs/assets/City0.json">City0.json</a> file:
|
||||
]</pre><span class="label label-info">Note</span>: In <span class="version">v2.14.3</span>, the contents of the array can also contain table cell markup (i.e. <code>"<td class='green'>+ 10%</td>"</code>).<br>
|
||||
<br>Here is some example JSON (comments added, but not allowed in JSON) which is contained in the <a href="https://github.com/Mottie/tablesorter/blob/master/docs/assets/City0.json">City0.json</a> file:
|
||||
<pre class="prettyprint lang-javascript">{
|
||||
// total rows
|
||||
"total_rows": 80,
|
||||
|
@ -464,8 +464,8 @@ tsp = ts.pager = {
|
||||
for ( i = 0; i < l; i++ ) {
|
||||
tds += '<tr>';
|
||||
for ( j = 0; j < d[i].length; j++ ) {
|
||||
// build tbody cells
|
||||
tds += '<td>' + d[i][j] + '</td>';
|
||||
// build tbody cells; watch for data containing HTML markup - see #434
|
||||
tds += /^\s*\<td/.test(d[i][j]) ? $.trim(d[i][j]) : '<td>' + d[i][j] + '</td>';
|
||||
}
|
||||
tds += '</tr>';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user