Skip to content

Commit

Permalink
Use formatExtraData when filtering and searching a formatted field
Browse files Browse the repository at this point in the history
  • Loading branch information
dana2208 committed Feb 1, 2016
1 parent db51065 commit 9de2e9e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/store/TableDataStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ export class TableDataStore {
let filterVal = filterObj[key].toLowerCase();
let targetVal = row[key];
if(this.colInfos[key]) {
const { format, filterFormatted } = this.colInfos[key];
const { format, filterFormatted, formatExtraData } = this.colInfos[key];
if(filterFormatted && format) {
targetVal = format(row[key], row);
targetVal = format(row[key], row, formatExtraData);
}
}
if (targetVal.toString().toLowerCase().indexOf(filterVal) == -1) {
Expand Down Expand Up @@ -228,10 +228,10 @@ export class TableDataStore {
searchTextArray.forEach( text => {
let filterVal = text.toLowerCase();
let targetVal = row[key];
const { format, filterFormatted } = this.colInfos[key];
const { format, filterFormatted, formatExtraData } = this.colInfos[key];

if(filterFormatted && format) {
targetVal = format(targetVal, row);
targetVal = format(targetVal, row, formatExtraData);
}
if (targetVal.toString().toLowerCase().indexOf(filterVal) !== -1) {
valid = true;
Expand Down

0 comments on commit 9de2e9e

Please sign in to comment.