Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted April 16, 20196 yr 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!
April 16, 20196 yr 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.
April 16, 20196 yr Author 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?
April 16, 20196 yr 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.
April 16, 20196 yr Author 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.