Ordering nested data that comes from an ajax call

Ordering nested data that comes from an ajax call

markusguenthermarkusguenther Posts: 4Questions: 2Answers: 0

Hi there.

I have a datatable that recieves all data via ajax. The data for one column can be an object, because i want to render the title but will order by the timestamp of the object.

Normally i will add data-order in the createRow function. But in this special case one column is invisible and i can not add the data attribute.

My default ordering is something like this:
defaultOrdering = [
[userColumnIndex, 'asc'],
[eventColumnIndex, 'desc']
];

And the eventColumn contains an object with properties like title, timestamp and so on. And can be invisible because i use this column for grouping the data in the table by an event.

It is possible to use a notation like:
"columns": [
{ "data": "name" },
{ "data": "hr.position" },
{ "data": "contact.0" },
{ "data": "contact.1" },
{ "data": "hr.start_date" },
{ "data": "hr.salary" }
]

for ordering???

Hope that it is not to confusing.

Answers

  • markusguenthermarkusguenther Posts: 4Questions: 2Answers: 0

    Ok ... the documentation says that ordering only accept an array with the index and the ordering (asc or desc).

This discussion has been closed.