How to refresh dataTables when using server-side processing (not AJAX source)?
How to refresh dataTables when using server-side processing (not AJAX source)?
newtodatatables
Posts: 31Questions: 0Answers: 0
Hi, I am having trouble refreshing my dataTables after using one of the examples shown here http://www.codeproject.com/KB/java/JQuery-DataTables-Java.aspx (under Server side generated tables section) I want to add a button that allows the user to refresh the table that retrieves data from database. and I have tried using fnClearTable, fnReloadAjax and also fnDraw but none seems to work. I have no problems if I used a AJAX source. I am wondering if i made any mistakes..
Part of my Script
[code]
$.fn.dataTableExt.oApi.fnReloadAjax = function ( oSettings, sNewSource ) {
if ( typeof sNewSource != 'undefined' )
oSettings.sAjaxSource = sNewSource;
this.fnClearTable( this );
this.oApi._fnProcessingDisplay( oSettings, true );
var that = this;
$.getJSON( oSettings.sAjaxSource, null, function(json) {
/* Got the data - add it to the table */
for ( var i=0 ; i
<%=c.getName()%>
<%=c.getAddress()%>
<%=c.getTown()%>
<%
}
%>
Refresh
[/code]
Part of my Script
[code]
$.fn.dataTableExt.oApi.fnReloadAjax = function ( oSettings, sNewSource ) {
if ( typeof sNewSource != 'undefined' )
oSettings.sAjaxSource = sNewSource;
this.fnClearTable( this );
this.oApi._fnProcessingDisplay( oSettings, true );
var that = this;
$.getJSON( oSettings.sAjaxSource, null, function(json) {
/* Got the data - add it to the table */
for ( var i=0 ; i
<%=c.getName()%>
<%=c.getAddress()%>
<%=c.getTown()%>
<%
}
%>
Refresh
[/code]
This discussion has been closed.
Replies
Allan
Allan
Allan