sending a aoColumnDefs structure via ajax - 2 things I don't get right
sending a aoColumnDefs structure via ajax - 2 things I don't get right
Hello,
I am using DataTables within my project, written in php. php controls which columns should be displayed so the fist request from the page sends back via Ajax a aoColumnDefs structure. At that time the table is rendered, empty (this is were my first unknown is). The second call to the server will send back the data once the user as filled in one or more fields indicating what he/she wants to retrieve an by and large it works as expected bar two things:
- when the table is first rendered with no records, I have not found a way to hide the 'processing..' div which leads to user confusion
- When sending the data structure, some columns are for example dates and I have not found a way to send a fnRender function back via ajax as it is received as a string, so not interpreted as a function in DT. In that case the sorting on date columns is wrong (as the server needs to send the date in user format which is for instance dd/mm/yyyy)
Any pointer or suggestion would be greatly appreciated
Best regards
Didier
I am using DataTables within my project, written in php. php controls which columns should be displayed so the fist request from the page sends back via Ajax a aoColumnDefs structure. At that time the table is rendered, empty (this is were my first unknown is). The second call to the server will send back the data once the user as filled in one or more fields indicating what he/she wants to retrieve an by and large it works as expected bar two things:
- when the table is first rendered with no records, I have not found a way to hide the 'processing..' div which leads to user confusion
- When sending the data structure, some columns are for example dates and I have not found a way to send a fnRender function back via ajax as it is received as a string, so not interpreted as a function in DT. In that case the sorting on date columns is wrong (as the server needs to send the date in user format which is for instance dd/mm/yyyy)
Any pointer or suggestion would be greatly appreciated
Best regards
Didier
This discussion has been closed.
Replies
I am only left with 'how to hide the 'processing...' div when a datatable is set-up and no data is yet retrieved.
[code]
$('#{table_id}_processing').hide(); // replace {table_id} with your actual table ID
[/code]
I find myself having to do this when I override the callback function using the Editable plug-in