Dynamic refresh on the table
Dynamic refresh on the table
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..
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..
This discussion has been closed.
Replies
{"aaData":[["123","start","end"],["543","test","Download"],"653","now","Download"],["45","test","end"]]}
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?
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 );
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.
Allan