how is this possible
how is this possible
javismiles
Posts: 205Questions: 38Answers: 3
I love the https://editor.datatables.net/,
its a great idea and features are perfect, i really love it
i want to purchase it so i am testing it with the generator, generating code for simple tables,
but 80% of times when i run it i get this error:
DataTables warning: JSON data from server could not be parsed. This is caused by a JSON etc etc
its very frustrating, how is this possible, this seems far too inestable unless i am missing something very basic in here
i am testing it with simple things like a couple of text fields in a table of my database, sometimes it works
but most times gives that error with short or long tables
please help
its a great idea and features are perfect, i really love it
i want to purchase it so i am testing it with the generator, generating code for simple tables,
but 80% of times when i run it i get this error:
DataTables warning: JSON data from server could not be parsed. This is caused by a JSON etc etc
its very frustrating, how is this possible, this seems far too inestable unless i am missing something very basic in here
i am testing it with simple things like a couple of text fields in a table of my database, sometimes it works
but most times gives that error with short or long tables
please help
This discussion has been closed.
Replies
@javismiles - What was the error?
Allan
in the end i used Google Chrome Debugger to easily see the ajax errors being returned,
that way its very easy to find out what's wrong,
in my case there were two big issues that i feel you should alert people more clearly about
1) The default primary key is always assumed to be ID, in one of my tables was USERID, this broke it all, so i had to set default to USERID and then it worked
// $this->pkey( $pkey );
$this->pkey( "userid" );
2) DATES fields, timeZone not set in PHP, i had to set it to make it work
in files format and validate of editor
like this:
namespace DataTables\Editor;
date_default_timezone_set('America/Los_Angeles');
same in both files
Im a developer and i know how hard is to cover all cases in auto generating tools so i totally understand its not possible to explain all these little details in any case
Agreed! I did actually have a pkey field in the original version of generator, and then simplified it... I'm going to put it back in.
> 2) DATES fields, timeZone not set in PHP, i had to set it to make it work
I might put that in an FAQ, but it is a fairly generic PHP issue. I'll see if it comes up again (at which point it will become an FAQ :-) ).
Thanks for the feedback!
Allan