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

vbprogrammervbprogrammer 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

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Do you mean something like this?

    Allan

  • vbprogrammervbprogrammer Posts: 4Questions: 1Answers: 0

    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!

  • vbprogrammervbprogrammer Posts: 4Questions: 1Answers: 0

    Also, do I need the editor to do this or can I do it in the basic DataTables?

  • vbprogrammervbprogrammer Posts: 4Questions: 1Answers: 0

    I don't want/need to perform any table edits. This is for a pbx smdr record application.

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    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 :)

    so the search will filter based on child rows as well

    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

Sign In or Register to comment.