You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 22, 2019. It is now read-only.
Currently, the sortable=True option only sorts when the columns are in raw number. Any formatting that turns that numbers into string will yield erroneous order.
For instance, 12.5% will be ranked higher than 2.1% when sorted in descending order, because the first character 1 is smaller than 2. To fix this I have locally modified the sort.js file as follow:
import R from 'ramda';
export default function sortRows(rows, sortColumn, sortDirection) {
function comparer(a, b) {
x = parseFloat(a[sortColumn]);
y = parseFloat(b[sortColumn]);
if (sortDirection === 'ASC') {
if isNan(x):
return (a[sortColumn] > b[sortColumn]) ? 1 : -1;
else:
return (x > y) ? 1 : -1;
} else if (sortDirection === 'DESC') {
if isNan(x):
return (a[sortColumn] < b[sortColumn]) ? 1 : -1;
else:
return (x < y) ? 1 : -1;
}
}
return (sortDirection === 'NONE' ?
rows : R.sort(comparer, rows.slice(0))
);
}
Nonetheless, this doesn't seem to fix the problem. Are there any patch planned for this feature?
Thanks
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently, the sortable=True option only sorts when the columns are in raw number. Any formatting that turns that numbers into string will yield erroneous order.
For instance, 12.5% will be ranked higher than 2.1% when sorted in descending order, because the first character 1 is smaller than 2. To fix this I have locally modified the sort.js file as follow:
Nonetheless, this doesn't seem to fix the problem. Are there any patch planned for this feature?
Thanks
The text was updated successfully, but these errors were encountered: