Server-Side Processing does not redraw the table
Server-Side Processing does not redraw the table
$(document).ready(function() {
var tableExample = jQuery('#client_table').DataTable(
{ "bJQueryUI": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"bSearchable": true,
"bFilter": true,
"bVisible":true,
"iDisplayLength": 100,
"type":"POST",
"sAjaxSource": my_custom_url.ajax_url+'?action=fn_my_ajaxified_dataloader_ajax',
"fnServerData": function( sUrl, aoData, fnCallback )
{
aoData.push( { "name": "min", "value": $('#min').val() } );
aoData.push( { "name": "max", "value": $('#max').val() } );
jQuery.ajax( {
"url": sUrl,
"data": aoData,
"success": fnCallback,
"dataType": "json",
"cache": false
} );
},
"sAjaxDataProp": "aaData",
"aaSorting": [[ 0, "desc" ]],
"aoColumnDefs": [
{ "bSearchable": false, "aTargets": [ 10,13 ] },
{ 'bSortable' : false, 'aTargets' : [ 13 ] }
],
"createdRow": function( row, data, dataIndex )
{
$(row).attr('id', data[14]);
},
} ) ;
jQuery('#min','#max').on( 'keyup click change', function () { tableExample.fnFilter( jQuery(this).val(), 0 );} );
jQuery('#filter').on("click",function(){window.location.reload();});
// oSettings = tableExample.fnSettings();
// Apply the search
jQuery('#client_table tfoot th').each( function (){
var title = jQuery(this).text();
jQuery(this).html( '<input type="text" placeholder=" " style="height:40px; width:100%; background-color:none!important" />');
} );
tableExample.columns().every(function(){
var that = this;
jQuery( 'input', this.footer() ).on( 'keyup change', function (){
if ( that.search() !== this.value ){
that
.search( this.value )
.draw();
}
});
});
});
and server response is
{"sEcho": 1, "iTotalRecords": 80, "iTotalDisplayRecords": 74, "aaData": [ ["2016-03-14 23:39:42","0"
,"sandeep14","12312312313","2147483647","sandeep14@gmail.com","810","","","等待審批","<a href='admin.php
but it is not draw table.