Number sorting in AG-grid table #4166
-
I'm using this to show a value in a table in an app { The values in the table are correctly displayed, but when I sort descending, the number is sorter alphabetically, so 901 comes before 91. I tried to set cellRendererType to number as per the documentation, but that does not neem to work. The strange thing is that the calulated value is correct, just the sorting handles it as a string. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I learned that the output is still not explicitly a number, but also with parseInt(value / 1024 / 1024) it does not sort the table on the numeric value but the alphabetic value (descending: 310 comes before 3000) I noticed that the dropdown only shows Type and Link, which might indicate the table simply does not accept numeric values, correct? |
Beta Was this translation helpful? Give feedback.
-
Adding "cellDataType": "number", also seems to fail... |
Beta Was this translation helpful? Give feedback.
-
For some reason, setting that to object (toggle raw, that add this line: "cellDataType": "object",) fixes is... |
Beta Was this translation helpful? Give feedback.
For some reason, setting that to object (toggle raw, that add this line: "cellDataType": "object",) fixes is...