remove indexForSort (#2501) until another stable sort problem is reported

This commit is contained in:
afc163 2016-08-23 18:00:01 +08:00
parent 47a3b04eb1
commit 37c3de6b83

View File

@ -254,11 +254,11 @@ export default class Table extends React.Component {
return;
}
return (a, b) => {
let result = sortColumn.sorter(a, b);
const result = sortColumn.sorter(a, b);
if (result !== 0) {
return (sortOrder === 'descend') ? -result : result;
}
return a.indexForSort - b.indexForSort;
return 0;
};
}
@ -722,9 +722,6 @@ export default class Table extends React.Component {
let data = this.props.dataSource || [];
//
data = data.slice(0);
for (let i = 0; i < data.length; i++) {
data[i] = { ...data[i], indexForSort: i };
}
const sorterFn = this.getSorterFn();
if (sorterFn) {
data = data.sort(sorterFn);