Jump to content

Theme datatable connected to db


LewisP

Recommended Posts

Posted

Hey quick question,

How would I go about connecting an mysql database and formatting a datatable within the suite theme? 

 

For example:

Datatable.png

 

Is there any templates or tutorials on something like this? Thanks!

Posted

You can easily connect to the same or a separate database using our database handler: 

 

In terms of outputting/formatting the data, you could potentially use our table helper class (\IPS\Helpers\Table), else you would need to write your own code for this.

Posted
3 hours ago, bfarber said:

You can easily connect to the same or a separate database using our database handler: 

 

In terms of outputting/formatting the data, you could potentially use our table helper class (\IPS\Helpers\Table), else you would need to write your own code for this.

Thanks for the reply. Do you know of any templates/online resources that already do something with this table helper class I can work off of?

Posted

For the datatable you're showing which is DataTables, the data will need to be in JSON format if you want server-side loading and pagination, etc. The other way to do it is to loop over the TBODY output and write the tr/tds to the screen with the database values inserted, although depending on the number of rows, this could drastically impact performance.

Posted

Would it be advisable to just have an external php page that mimics the IPS suite theme instead for optimization purposes in that case?

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...