Server-Side Processing - Empty return aoData
Server-Side Processing - Empty return aoData
Hi,
Is there anyway to get the server-side processing to do the empty row when no data is passed back to the dataTable?
I have just run into this where I have done a search for something that doesn't exists and the table doesn't change and the processing div does not disapear after the return of the json (I am guessing because aoData is empty
[code]
{ // other details returned ...
'aoData': [] }
[/code]
Regards,
Izzy
Is there anyway to get the server-side processing to do the empty row when no data is passed back to the dataTable?
I have just run into this where I have done a search for something that doesn't exists and the table doesn't change and the processing div does not disapear after the return of the json (I am guessing because aoData is empty
[code]
{ // other details returned ...
'aoData': [] }
[/code]
Regards,
Izzy
This discussion has been closed.
Replies
That looks perfectly valid to me actually - and this should work! If you have a look at this example - http://datatables.net/examples/data_sources/server_side.html - and type 'rubbish' into the search box, you'll see that this should work, and aaData (not aoData!) is an empty array.
Perhaps if you could post your full JSON string (or run it through jsonlint.com) that would be helpful, as it sounds like the JSON might not be valid.
Regards,
Allan
I run in to the same problem.
The JSON look´s like this
[code]
{"sEcho": 2, "iTotalRecords": 9, "iTotalDisplayRecords": 0, "aaData": [] }
[/code]
I also get an error in firebug
"oSettings.aoData[iDataIndex] is undefined"
Can´t find whats wrong, so please give me some hints where i can look.
Regards,
Ingvar
[code]
$('#adminData tbody td').each( function () {
var oaSettings = oaTable.fnSettings();
if(oaSettings._iRecordsDisplay != 0){ //Solution : if empty data don't set click function
var iPos = oaTable.fnGetPosition( this );
[/code]