Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

Server side Datatables connection


Hi I have purchased the Metronic 8.1.5v recently and I need to have my Datatables populated with the server side mySQL data which I already have.

I am not able to get clear instructions on how to point my Datatables to my server side database and its corresponding table.

I understand I should write a separate server side script, but not able to get the correction information on the same on where to write and how to do it.

I am using the HTML version


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi,

Thank you for your interest in Metronic.

To use the datatables plugin with server side data source you can refer to the official documentation here.

You can also check Metronic's example of the Datatables server-side processing here. Please note that this example uses custom PHP code as example and you should implement your own server-side code referring to the above official docs.

If we can help with anything else please let us know.

Regards.



With you server side processing example, if I understand correctly...
the HTML points to the JS, where the data is supposed collected via Ajax from DataTables.php, which in turn connects to class-utils.php.... but no where it links to the database on server... where is that info on how to connect to database on server?



Hi,

Our examples are for demo purposes the database connection is not used. Since it's the example for the HTML theme the database and backend implementation is not covered. We just simulate the data source generation using PHP.

In your case you just need to refer to the Datatables docs and understand the parameters structure for request/response for the server side data processing. Then you can implement your own implementation according to project requirements.

Regards.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(