Create row children tables via HTML?

Create row children tables via HTML?

DolanTheMFMSWizardDolanTheMFMSWizard Posts: 4Questions: 4Answers: 0

Is there a way to hardcore in HTML row children? For example

<tbody>
    <tr id="parent"><td>Name</td></tr>
    <tr id="child">
        <table>
        </table>
    </tr>
</tbody>

then show and hide it doing table.row($('#parent')).child.show() or hide()? I tried doing this but it confuses DataTablesJS and then I can't have sort or search. Also I want search to be able to work on the child tables. Thanks in advanced.

Answers

  • kthorngrenkthorngren Posts: 20,545Questions: 26Answers: 4,818

    Is there a way to hardcore in HTML row children?

    The example shows the use of a format function that has the row data passed to it. In the format function you can create whatever valid HTML you want to show the child row details. The table you show in your example doesn't seem like it would work correctly for this solution.

    Maybe you can provide a test case with an example of what you are trying to do. This would give us a better understanding of what you are trying to do and allow us to help.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

This discussion has been closed.