I downloaded all of the examples but I can't seem to get the server side processing working.
Is this a common problem? What do I need to chance to get it to work?
I am working on server side processing (java servlet). I create a datatable with data (json object) from servlet and display the data in datatable. It work fine. When I click button to reload new data (json object) from servlet and the new data come to jsp page. But, it does not display in datatable. How to install or reload data into existing datatable?
The second time, I use the following code to get data:
$.post("SearchServlet",
{searchString:$searchString,},
function(json) {
searchDataTableObj.fnDraw(json);
alert(json.aaData);
//fnCallback(json);
} );
@Blalien : Check out the 'server-side processing' section of the FAQs: http://datatables.net/faqs . There are a few tips there which might help. There shouldn't be any problems in getting server-side processing to work with DataTables, it's just a little bit more difficult than a single function call though :-)
@kevingewang : Different subject, but here we go: try using the fnReloadAjax plug-in http://datatables.net/plug-ins/api#fnReloadAjax (assuming your are using Ajax source and not server-side processing).
Replies
I am working on server side processing (java servlet). I create a datatable with data (json object) from servlet and display the data in datatable. It work fine. When I click button to reload new data (json object) from servlet and the new data come to jsp page. But, it does not display in datatable. How to install or reload data into existing datatable?
The second time, I use the following code to get data:
$.post("SearchServlet",
{searchString:$searchString,},
function(json) {
searchDataTableObj.fnDraw(json);
alert(json.aaData);
//fnCallback(json);
} );
@kevingewang : Different subject, but here we go: try using the fnReloadAjax plug-in http://datatables.net/plug-ins/api#fnReloadAjax (assuming your are using Ajax source and not server-side processing).
Allan