LewisP Posted April 16, 2019 Posted April 16, 2019 Hey quick question, How would I go about connecting an mysql database and formatting a datatable within the suite theme? For example: Is there any templates or tutorials on something like this? Thanks!
bfarber Posted April 16, 2019 Posted April 16, 2019 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.
LewisP Posted April 16, 2019 Author Posted April 16, 2019 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?
Joy Rex Posted April 16, 2019 Posted April 16, 2019 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.
LewisP Posted April 16, 2019 Author Posted April 16, 2019 Would it be advisable to just have an external php page that mimics the IPS suite theme instead for optimization purposes in that case?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.