问题
This is how i return my dataset when no results found for particular search in dataTable serverside processing
data :null
recordsFiltered:"0"
recordsTotal:"0"
but frondend doesnt show any no result found message .its stuck with processing. and console give an error
Uncaught TypeError: Cannot read property 'length' of null
maybe this is null means my data=null.
how can I show datatable default message saying no search results. ? i'm using datatable version 1.10.13 with serverside processing , pls advice
回答1:
You need to return empty array in data
property, see sample JSON response below:
{
"draw": 1,
"recordsFiltered": 0,
"recordsTotal": 0,
"data": []
}
来源:https://stackoverflow.com/questions/41431205/why-does-datatable-doesnt-show-empty-data-message