Can column.data() be made to return orthogonal data?
Can column.data() be made to return orthogonal data?
Link to test case: https://live.datatables.net/zefijaxe/1/edit?html,js,console,output
Description of problem:
I haven't been able to get the test case example to work -- the column().data() call returns an unexpected empty array (though the real code does return the expected columnar data locally). While baffling, that's not the real issue. ![]()
The real question seems simple enough to be answered without the working example: The expected output from the example would be the formatted dates (the default _ orthogonal data used for display): Mon 25th Apr 11, Mon 25th Jul 11, Mon 12th Jan 09, ...
Instead, is there a way to return the timestamps (the sort orthogonal data): 1303689600, 1311552000, 1231718400, ...?
This question has an accepted answers - jump to answer
Answers
The statement is executed before Datatables initialization is complete. The
ajaxrequest is asynchronous causing the Datatables init to be delayed until the response. I placed the code ininitCompleteto execute when fully initialized.Use
cell().render()orcells().render()to get the orthogonal data. For example:Where
nullis therow-selectorparameter. Anullor no selectorrow-selectorreturns all rows.Updated example:
https://live.datatables.net/zefijaxe/2/edit
Kevin