Dynamic refresh on the table

Dynamic refresh on the table

babusbabus Posts: 13Questions: 0Answers: 0
edited January 2013 in General
Hi Allan,

I am using sAjaxSource to load the data to the table. the source is a php (customized) file which will get the data from the multiple database table and echo the output as json (as per the definition). It loads the table perfectly for firsttime & I am trying to reload or refresh the table, via fnDraw() and fnReloadAjax() call.. but nothing helping me...


Could you please guide me on this...

Thanks for your help..

Replies

  • babusbabus Posts: 13Questions: 0Answers: 0
    edited January 2013
    my php file output format will be...

    {"aaData":[["123","start","end"],["543","test","Download"],"653","now","Download"],["45","test","end"]]}
  • girishmrgirishmr Posts: 137Questions: 0Answers: 0
    Need more info to help.

    What ver of DT are you using? What does your initialization of DT look like?? Are you using serverside? If so even when you use the fnReloadAjx plugin, it forces the fnDraw() rather than reload.
    Also need to know in what situation / condition you are trying to refresh your table?
  • babusbabus Posts: 13Questions: 0Answers: 0
    Hi Grishmr.

    1) Latest version (1.9)
    2) yes i am using server side since i am getting the multiple database tables via php script.
    3) I am using a refresh button, While clicking i am clicking i am calling fnDraw()

    See my problem is,
    I am highly doubt on the way that i am using php script to get the table data. i am just forming an aaData array based on my results.. returning it json format.. is that a correct way?
    or do we need to consider about other varibles like aColumns,Stable as given in this example http://www.datatables.net/examples/data_sources/server_side.html .. i am not using that kind of php script. i am just forming output array and echoing that in json format...

    my php file will be like below :

    $output = array(
    "aaData" => array()
    );

    $output ['aaData'][] = /// result array from my own customized script.

    echo json_encode( $output );
  • babusbabus Posts: 13Questions: 0Answers: 0
    FYI,

    If i replace my customized php file with the php file that shown in that example (http://www.datatables.net/examples/data_sources/server_side.html ), the refresh is happening without any issues while calling fnDraw() method.

    But the drawback in that script is we cannot use that to get the data from multiple database tables.
    which is required in my table.
  • babusbabus Posts: 13Questions: 0Answers: 0
    @allan please help. you only can answer for this...
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Please link to a test case, otherwise we don't really stand much of a chance of being able to help. See: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    Allan
This discussion has been closed.