PHP, MySQL and DataTables Child Rows. How can I populate the DataTable with ChildRows
PHP, MySQL and DataTables Child Rows. How can I populate the DataTable with ChildRows
vbprogrammer
Posts: 4Questions: 1Answers: 0
I am looking for an example of PHP, MySQL and DataTables.
I need to populate the primary row from a [MasterTable] and then add multiple child rows from a [ChildTable].
Answers
https://datatables.net/examples/api/row_details.html
Do you mean something like this?
Allan
Yes. I think this might work. I would like all of the master and child records to be loaded at page load so the search will filter based on child rows as well. Will this example do this?
THANKS!
Also, do I need the editor to do this or can I do it in the basic DataTables?
I don't want/need to perform any table edits. This is for a pbx smdr record application.
No you don't need Editor to do that. You can just drop the Editor code from that example and it would work fine. It is effectively an extension of this example, just using a DataTable in the child row. You can use anything you want in the child row - it is just HTML
No. The search will only operate on the data in the parent table. You'd need to add the data you want to be searchable into the parent table rows (perhaps as a hidden column).
Allan