fix sort and filter perf

This commit is contained in:
afc163 2016-03-30 17:56:37 +08:00
parent 2651d80fc2
commit b4a75ddcc9

View File

@ -129,7 +129,9 @@ const Table = React.createClass({
Object.keys(filtersFromColumns).forEach(key => {
newFilters[key] = filtersFromColumns[key];
});
this.setState({ filters: newFilters });
if (this.isFiltersChanged(newFilters)) {
this.setState({ filters: newFilters });
}
}
},
@ -233,7 +235,7 @@ const Table = React.createClass({
};
// Controlled
if (this.getSortOrderColumns() === 0) {
if (this.getSortOrderColumns().length === 0) {
this.setState(newState);
}