[sql lab] fix numeric sort in data table (#3587)

Currently numerical values sort as alpha, this addresses the issue.
This commit is contained in:
Maxime Beauchemin 2017-10-04 10:17:01 -07:00 committed by GitHub
parent 15ecdeb3ba
commit 645de384e3

View File

@ -82,7 +82,7 @@ export default class FilterableTable extends PureComponent {
const newRow = {};
for (const k in row) {
const val = row[k];
if (typeof (val) === 'string') {
if (['string', 'number'].indexOf(typeof (val)) >= 0) {
newRow[k] = val;
} else {
newRow[k] = JSON.stringify(val);
@ -150,7 +150,6 @@ export default class FilterableTable extends PureComponent {
}
const rowGetter = ({ index }) => this.getDatum(sortedAndFilteredList, index);
return (
<div
style={{ height }}