Skip to content

Commit

Permalink
fix #517
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Jun 21, 2016
1 parent c824832 commit 1c71289
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/store/TableDataStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* eslint guard-for-in: 0 */
/* eslint no-console: 0 */
/* eslint eqeqeq: 0 */
/* eslint one-var: 0 */
import Const from '../Const';

function _sort(arr, sortField, order, sortFunc, sortFuncExtraData) {
Expand Down Expand Up @@ -423,9 +424,11 @@ export class TableDataStore {
break;
}
}

let format, filterFormatted, formatExtraData;
if (this.colInfos[key]) {
const { format, filterFormatted, formatExtraData } = this.colInfos[key];
format = this.colInfos[key].format;
filterFormatted = this.colInfos[key].filterFormatted;
formatExtraData = this.colInfos[key].formatExtraData;
if (filterFormatted && format) {
targetVal = format(row[key], row, formatExtraData);
}
Expand All @@ -449,6 +452,10 @@ export class TableDataStore {
break;
}
default: {
if (filterObj[key].type === Const.FILTER_TYPE.SELECT &&
filterFormatted && filterFormatted && format) {
filterVal = format(filterVal, row, formatExtraData);
}
valid = this.filterText(targetVal, filterVal);
break;
}
Expand Down

0 comments on commit 1c71289

Please sign in to comment.