refresh datatables
refresh datatables
pracede2005
Posts: 10Questions: 0Answers: 0
Hi,
I am trying to use datatables. It's a wonderful plugin. I want to refresh my datatable table when user click on button.
My table declaration:
[code]
Libellé
Statut
Responsable
Date création
Date modification
Actions
[/code]
Here is my code
[code]
$(document).ready(function() {
$('#tableId').dataTable( {
"bLengthChange": false,
"sPaginationType": "full_numbers",
"bFilter": false,
"bProcessing": true,
"sAjaxSource":'/json/SearchAction.action?'+params,
} );
} );
[/code]
My button:
[code]
[/code]
This is how i refresh table
[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 */
alert("Get data ....");
for ( var i=0 ; i
I am trying to use datatables. It's a wonderful plugin. I want to refresh my datatable table when user click on button.
My table declaration:
[code]
Libellé
Statut
Responsable
Date création
Date modification
Actions
[/code]
Here is my code
[code]
$(document).ready(function() {
$('#tableId').dataTable( {
"bLengthChange": false,
"sPaginationType": "full_numbers",
"bFilter": false,
"bProcessing": true,
"sAjaxSource":'/json/SearchAction.action?'+params,
} );
} );
[/code]
My button:
[code]
[/code]
This is how i refresh table
[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 */
alert("Get data ....");
for ( var i=0 ; i
This discussion has been closed.
Replies