Skip to content

Commit 9de2e9e

Browse files
committed
Use formatExtraData when filtering and searching a formatted field
1 parent db51065 commit 9de2e9e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/store/TableDataStore.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ export class TableDataStore {
190190
let filterVal = filterObj[key].toLowerCase();
191191
let targetVal = row[key];
192192
if(this.colInfos[key]) {
193-
const { format, filterFormatted } = this.colInfos[key];
193+
const { format, filterFormatted, formatExtraData } = this.colInfos[key];
194194
if(filterFormatted && format) {
195-
targetVal = format(row[key], row);
195+
targetVal = format(row[key], row, formatExtraData);
196196
}
197197
}
198198
if (targetVal.toString().toLowerCase().indexOf(filterVal) == -1) {
@@ -228,10 +228,10 @@ export class TableDataStore {
228228
searchTextArray.forEach( text => {
229229
let filterVal = text.toLowerCase();
230230
let targetVal = row[key];
231-
const { format, filterFormatted } = this.colInfos[key];
231+
const { format, filterFormatted, formatExtraData } = this.colInfos[key];
232232

233233
if(filterFormatted && format) {
234-
targetVal = format(targetVal, row);
234+
targetVal = format(targetVal, row, formatExtraData);
235235
}
236236
if (targetVal.toString().toLowerCase().indexOf(filterVal) !== -1) {
237237
valid = true;

0 commit comments

Comments
 (0)