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

didiergmdidiergm Posts: 14Questions: 0Answers: 0
edited August 2011 in General
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

Replies

  • didiergmdidiergm Posts: 14Questions: 0Answers: 0
    my second question may have found it's own solution : I should look at the sorting plugin first and if I get anymore issues I'll come back here

    I am only left with 'how to hide the 'processing...' div when a datatable is set-up and no data is yet retrieved.
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    I don't know if this is the right way to solve the "processing..." issue, but you can hide it with:
    [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
  • didiergmdidiergm Posts: 14Questions: 0Answers: 0
    thank you fbas I'll try that.
This discussion has been closed.