Editor & Large Data Set

Editor & Large Data Set

AdrianSmithUKAdrianSmithUK Posts: 26Questions: 10Answers: 0

Hi,

I've been using Editor as a homebrew CRM since 2015, and it has consistently performed well.

Recently, however, I've encountered an issue where my PHP installation runs out of memory. I increased the memory limit to 512MB, which seemed to resolve the issue temporarily.

I also used your Generator to create a new test case with the latest code, hoping the latest version of Editor would cure my problem. Unfortunately, it still appears to be quite memory-intensive.

Is there a configuration option that allows Editor to process only the first few pages initially and defer the processing of the remaining data until it's needed?

Thank you for your assistance.

Best regards,
Adrian Smith

Answers

  • kthorngrenkthorngren Posts: 21,327Questions: 26Answers: 4,949

    Use Server Side Processing which is a Datatables config option. The server side processing protocol doc provides more details. Here is an Editor example using server side processing. This requires the server script to perform paging. You can download Datatables provide PHP scripts which support server side processing.

    Kevin

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    If you are already using the Editor PHP libraries, all you need to do to enable server-side processing is add serverSide: true and make the Ajax request from the DataTable POST. The example Kevin linked to shows that in action.

    Regards,
    Allan

  • AdrianSmithUKAdrianSmithUK Posts: 26Questions: 10Answers: 0

    Many thanks Kevin and Allan, I have enabled the server side settings as you suggested. However, the browser still crashes. I think the json object is too big for it to process. Is there a way to say - just send me the first 100 rows - or does the editor need to download the full json 100mb object?

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Is there a way to say - just send me the first 100 rows

    Yup - that's what server-side processing is meant to do. It will return only the rows needed for the current page of display (10 by default).

    If it isn't working for you, can you link to the page showing the issue so I can take a look? It sounds like server-side processing hasn't been enabled fully. Did you make the DataTables Ajax request POST?

    Allan

  • kthorngrenkthorngren Posts: 21,327Questions: 26Answers: 4,949

    Server side processing is a client/server protocol. See the protocol docs. The client sends parameters to the server indicating the page and page length along with other parameters. The server script is expected to use these parameters to limit the response to the particular page and number of rows on the page. For a SQL like DB this is accomplished using LIMIT and OFFSET in the query. Also the server script is responsible for sorting and searching.

    Kevin

  • AdrianSmithUKAdrianSmithUK Posts: 26Questions: 10Answers: 0

    Thank you chaps. I hadn't set the ajax to POST.

Sign In or Register to comment.