Sorting nested json arrays

Sorting nested json arrays

gfrantgfrant Posts: 1Questions: 0Answers: 0

So i'm using the "ajax" parameter and pointing DataTables to a static file with json (so not technically Ajax), and the json has a format like this:

{
"data": [{
"key": value,
"anotherkey": [ 0.0001, 0.2, 1.35 ]
}
{
"key": value,
"anotherkey": [ 0.0001, 0.2, 1.35 ]
}
and so on ]

So all the values of "anotherkey" are not only all going in one column, they're also going in their own cell so one cell has an array of values.

When I sort asc or desc by clicking the column name at the top, it only uses the first value in the array. I tried modifying the datatables javascript file but was unsuccessful. How would you all go about doing this?

This discussion has been closed.