How to add a row to the inner table of nested tables?

How to add a row to the inner table of nested tables?

gh2mgh2m Posts: 63Questions: 16Answers: 0

I would like to have a button to add the row data. Is that possible?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,276Questions: 26Answers: 4,765

    Are you talking about the child detail rows of this example?
    https://datatables.net/examples/api/row_details.html

    Kevin

  • gh2mgh2m Posts: 63Questions: 16Answers: 0

    Not exactly. Here is the link to my test case: http://live.datatables.net/zibidoji/1/edit

    I hope user can fill name, team, server, and row number fields and clicks Add an inner row button to add it under the row number provided, in detailsTable table

  • kthorngrenkthorngren Posts: 20,276Questions: 26Answers: 4,765
    Answer ✓

    You are getting the following error:

    Uncaught TypeError: Cannot read property 'add' of undefined

    You need to change the child Datatable initialization to get a Datatable API instance by using DataTable() instead of dataTable(). Please see the API docs for more details. You need this:
    oInnerTable = $("#exampleTable_" + iTableCounter).DataTable({

    Here is the updated example:
    http://live.datatables.net/zibidoji/4/edit

    Kevin

  • gh2mgh2m Posts: 63Questions: 16Answers: 0

    This works great. Thank you Kevin.

This discussion has been closed.