Uncaught TypeError: Cannot read property 'length' of undefined
Uncaught TypeError: Cannot read property 'length' of undefined
crawln45
Posts: 8Questions: 0Answers: 0
Just wondering if anyone has any idea why this is happening.
http://home.mybluebox.net/mymovies/
Uncaught TypeError: Cannot read property 'length' of undefined jquery.DataTables.js:2107
happens when I type in anything in the genres column.
http://home.mybluebox.net/mymovies/
Uncaught TypeError: Cannot read property 'length' of undefined jquery.DataTables.js:2107
happens when I type in anything in the genres column.
This discussion has been closed.
Replies
Allan
> The problem is it's not showing 0 records to display
You are expecting it to show 0 records on page load?
Allan
That would do it. DataTables expects an empty array if there are no records. Are you able to modify the returned json? If not you'd need to use fnServerData to make your own Ajax call and then reformat the returned json.
Allan
Its simply `[]` . In PHP `echo json_encode( array() );` . Other languages will be different.
Allan