Trying get the example "Always shown checklist" working in my environment.

Trying get the example "Always shown checklist" working in my environment.

StanRStanR Posts: 63Questions: 11Answers: 1

My first question is about the data. I took the data under "Ajax load" and put it in a file. Can that file serve as my data source, or do I need to load that data into a database?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @StanR ,

    This might be useful here - I took that example and made a local editor version of it. There's no server backend, so no PHP or database, but everything else is there, so could be a good way for you to start.

    Cheers,

    Colin

  • StanRStanR Posts: 63Questions: 11Answers: 1

    Thanks for the response and example. Unfortunately, I have a requirement to use server-side processing in my project. Thought the example would show me how all the pieces fit together.

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @StanR ,

    The server script is shown on the example page. Is there something else you were expected?

    Cheers,

    Colin

  • StanRStanR Posts: 63Questions: 11Answers: 1

    Yes. I still don't know the answer to my original question. If you are doing server-side processing, does that mean you have to use a database. Or can a JSON file be your data store?

    Beyond that, I'm sure I need to edit config.php. To me, it looks as if the example is expecting a database. If that's the case, how do I get the data into the database.

  • allanallan Posts: 61,644Questions: 1Answers: 10,093 Site admin
    Answer ✓

    You don't have to use a database for server-side processing, but it is something I would very strongly recommend. The provided libraries (PHP, .NET and Node) make the assumption that a database will be used, so you'd need to write some custom code if you wanted to use a static file.

    The issue with server-side processing and a static file is that you would need to read the whole file in, then parse it, order it and filter it before you are able to send the information back to the client-side. The whole point of DataTables' server-side processing mode is that you can utilise a database engine which is already heavily optimised for that.

    You could I guess read the file into a temporary table on each request and then still use a database, but it seems a bit redundant to my mind.

    With client-side processing its a lot easier - you can load the JSON file and DataTables will do all the sorting and filtering and paging for you. But if the file is massive then that might not be suitable. Also the Editor libraries don't support updating a static file.

    If that's the case, how do I get the data into the database.

    For the demo? The SQL for the examples can be found here.

    Allan

  • StanRStanR Posts: 63Questions: 11Answers: 1

    Thank you, Allan (and Colin). I will install MySQL and load the data there.

This discussion has been closed.