"No Data Message" - sZeroRecords does not appear (Server-Side)
"No Data Message" - sZeroRecords does not appear (Server-Side)
Hi,
the sZeroRecords message does not appear, when I make a server-side post.
Otherwise, everything works.
My Json-Data Response is:
{"sEcho":1,"iTotalRecords":0,"iTotalDisplayRecords":0,"aaData":null}
My Code is:
[code]
$('#searchDataTable').dataTable(
{
"oLanguage": {
"sInfoFiltered": "(Seiten: _MAX_)",
"sLengthMenu": "Pro Seite: _MENU_",
"sZeroRecords": "Keine Daten gefunden.",
"sInfo": "Anzeige der Treffer: _START_ - _END_ von _TOTAL_",
"oPaginate": {
"sPrevious": " ",
"sNext": " ",
"sLast": " ",
"sFirst": " "}
},
"sDom": '<"top">rt<"bottom" <"bottom1"il><"clear"><"bottom2"p>><"clear">',
"sPaginationType": "full_numbers",
"bFilter": false,
"bStateSave": true,
"bServerSide": true,
"sAjaxSource": contextPath + "/index.html?action=sort",
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.each(searchForm, function() {
aoData.push({"name": this.name, "value": this.value});
}),
$.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
},
"aaSorting": [],
"aoColumns": [
{ "sName": "lfdnr", "bVisible": false },
{ "sName": "lfdnrformat","fnRender": function( obj )
{
sReturn ='
the sZeroRecords message does not appear, when I make a server-side post.
Otherwise, everything works.
My Json-Data Response is:
{"sEcho":1,"iTotalRecords":0,"iTotalDisplayRecords":0,"aaData":null}
My Code is:
[code]
$('#searchDataTable').dataTable(
{
"oLanguage": {
"sInfoFiltered": "(Seiten: _MAX_)",
"sLengthMenu": "Pro Seite: _MENU_",
"sZeroRecords": "Keine Daten gefunden.",
"sInfo": "Anzeige der Treffer: _START_ - _END_ von _TOTAL_",
"oPaginate": {
"sPrevious": " ",
"sNext": " ",
"sLast": " ",
"sFirst": " "}
},
"sDom": '<"top">rt<"bottom" <"bottom1"il><"clear"><"bottom2"p>><"clear">',
"sPaginationType": "full_numbers",
"bFilter": false,
"bStateSave": true,
"bServerSide": true,
"sAjaxSource": contextPath + "/index.html?action=sort",
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.each(searchForm, function() {
aoData.push({"name": this.name, "value": this.value});
}),
$.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
},
"aaSorting": [],
"aoColumns": [
{ "sName": "lfdnr", "bVisible": false },
{ "sName": "lfdnrformat","fnRender": function( obj )
{
sReturn ='
This discussion has been closed.
Replies
Allan
can you show how a empty array should look like in Json.
These Json Responses don't work
{"error":false,"sEcho":0,"iTotalRecords":0,"iTotalDisplayRecords":0,"aaData":[[null,null,null,null,null,null,null,null,null,null,null]]}
{"error":false,"sEcho":0,"iTotalRecords":0,"iTotalDisplayRecords":0,"aaData":[]}
{"error":false,"sEcho":0,"iTotalRecords":0,"iTotalDisplayRecords":0,"aaData":[[]]}
Kai
with an empty array everything is working now :) (there was an other bug).
Thanks for help!!!