Core: save raw table cell data

This commit is contained in:
Mottie 2015-02-09 15:23:41 -06:00
parent 9ff5a2ef5f
commit fec49e144a
2 changed files with 6 additions and 2 deletions

View File

@ -5301,7 +5301,7 @@ var config = $('#mytable').data('tablesorter');
<tr id="variable-cache">
<td><a href="#" class="permalink">config.cache</a></td>
<td>Object</td>
<td>Internal list of table contents (<span class="version">v2.0.18</span>; <span class="version updated">v2.16.0</span> )
<td>Internal list of table contents (<span class="version">v2.0.18</span>; <span class="version updated">v2.19.1</span> )
<div class="collapsible">
<br>
This object contains the following:<br>
@ -5331,6 +5331,8 @@ $('.tablesorter')[0].config.cache[0].normalized[0];
/* result: ["a1", "bruce", "almighty", 45, 153.19, 44.7, 77, 979830720000, {
$row : jQuery.fn.jQuery.init[1], // row (jQuery object)
child : [], // child row raw html, if any
// raw unparsed data from the table cells - added v2.19.1
raw : ["A1", "Bruce", "Almighty", "45", "$153.19", "44.7%", "+77", "Jan 18, 2001 9:12 AM"],
order : 3 // original row index (unsorted)
}]
*/</pre>

View File

@ -326,7 +326,8 @@
rowData = {
// order: original row order #
// $row : jQuery Object[]
child: [] // child row text (filter widget)
child: [], // child row text (filter widget)
raw: [] // original row text
};
/** Add the table data to main data array */
$row = $($tb[k].rows[i]);
@ -356,6 +357,7 @@
continue;
}
t = getElementText(table, $row[0].cells[j], j);
rowData.raw.push(t); // save original row text
// do extract before parsing if there is one
if (typeof extractors[j].id === 'undefined') {
tx = t;