Editor initialisation is extremely slow
Editor initialisation is extremely slow

Hi,
I'm using Editor with PHP server side processing.
Our database has around 70,000 rows.
The initialisation/loading takes at least 1 minute and even sometimes makes the browser go in to not responding.
Is there a way to speed this up?
Thanks,
Scott
This discussion has been closed.
Answers
1 minute is exceptionally slow! You note you are using server-side processing, have you set DataTables to make a POST request (assuming you are processing POST parameters in the PHP).
There is an example of that shown here.
Beyond that, perhaps you could show me the PHP and also a debugger trace.
Thanks,
Allan
Hi Allan,
Believe it or not I somehow missed out the complete server-side processing part.
I was using this code:
so I changed it to this:
and now it's more than less instant on page load.
I have no idea how I managed to do that, in my head I was using server-side processing. What was happening in my case prior to making the change?
Thanks,
Scott
No worries :-)
Before it was using client-side processing, so all 70'000 rows were being read from the database and sent to the client at table load time.
Editor's libraries will automatically detect a server-side processing request and switch into that mode, which is why the little change you made allowed it to work in server-side processing mode.
Allan
Hi Allan,
Thanks.
Appears switching to server-side processing has broken search.
I am using an SQLite database and search did work when we were using client-side processing.
Here is the relevant part in PHP, if it is the problem with server-side processing?
Thanks,
Scott
Hi,
Could you confirm which version of Editor you are using please? Line 556 in Query.php in 1.4.2 is in the middle of a comment block.
I very strongly suspect that the library is attempting to execute your column name because it matches a PHP built in function name. If you were to call it something my 'regDate' it should work.
However, if that is an issue in the current libraries it would be good to fix it :-)
Allan
Hi Allan,
Line 556 is:
I appear to be using an older version at the moment.
I'll gave changing the name a shot.
Thanks,
Scott
Hi Allan,
Yep that sorted it.
Thanks,
Scott
Fantastic - good to hear. Thanks for letting me know.
Allan