mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Filter: prevent undefined error. Fixes #819
This commit is contained in:
parent
e7bbf5d5a7
commit
15284156d8
@ -1260,11 +1260,12 @@ ts.filter = {
|
|||||||
data.anyMatch = true;
|
data.anyMatch = true;
|
||||||
data.rowArray = $cells.map(function(i){
|
data.rowArray = $cells.map(function(i){
|
||||||
if ( $.inArray(i, columnIndex) > -1 ) {
|
if ( $.inArray(i, columnIndex) > -1 ) {
|
||||||
var txt;
|
var txt, $this;
|
||||||
if (data.parsed[i]) {
|
if (data.parsed[i]) {
|
||||||
txt = data.cacheArray[i];
|
txt = data.cacheArray[i];
|
||||||
} else {
|
} else {
|
||||||
txt = this.getAttribute( c.textAttribute ) || this.textContent || $(this).text();
|
$this = $(this);
|
||||||
|
txt = $this.length ? $this.attr( c.textAttribute ) || this.textContent || $this.text() : '';
|
||||||
txt = $.trim( wo.filter_ignoreCase ? txt.toLowerCase() : txt );
|
txt = $.trim( wo.filter_ignoreCase ? txt.toLowerCase() : txt );
|
||||||
if (c.sortLocaleCompare) {
|
if (c.sortLocaleCompare) {
|
||||||
txt = ts.replaceAccents(txt);
|
txt = ts.replaceAccents(txt);
|
||||||
@ -1319,8 +1320,8 @@ ts.filter = {
|
|||||||
if (wo.filter_useParsedData || data.parsed[columnIndex]) {
|
if (wo.filter_useParsedData || data.parsed[columnIndex]) {
|
||||||
data.exact = data.cache;
|
data.exact = data.cache;
|
||||||
} else {
|
} else {
|
||||||
val = $cells[columnIndex];
|
val = $cells.eq(columnIndex);
|
||||||
result = $.trim( val.getAttribute( c.textAttribute ) || val.textContent || $cells.eq(columnIndex).text() );
|
result = val.length ? $.trim( val.attr( c.textAttribute ) || val[0].textContent || val.text() ) : '';
|
||||||
data.exact = c.sortLocaleCompare ? ts.replaceAccents(result) : result; // issue #405
|
data.exact = c.sortLocaleCompare ? ts.replaceAccents(result) : result; // issue #405
|
||||||
}
|
}
|
||||||
data.iExact = !regex.type.test(typeof data.exact) && wo.filter_ignoreCase ? data.exact.toLocaleLowerCase() : data.exact;
|
data.iExact = !regex.type.test(typeof data.exact) && wo.filter_ignoreCase ? data.exact.toLocaleLowerCase() : data.exact;
|
||||||
@ -1506,7 +1507,7 @@ ts.filter = {
|
|||||||
} else {
|
} else {
|
||||||
cell = row.cells[column];
|
cell = row.cells[column];
|
||||||
if (cell) {
|
if (cell) {
|
||||||
arry.push( $.trim( cell.getAttribute( c.textAttribute ) || cell.textContent || $(cell).text() ) );
|
arry.push( $.trim( $(cell).attr( c.textAttribute ) || cell.textContent || $(cell).text() ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
17
js/jquery.tablesorter.widgets.min.js
vendored
17
js/jquery.tablesorter.widgets.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user