Nested Tables

Nested Tables

ITARulezITARulez Posts: 10Questions: 0Answers: 0
edited July 2013 in General
Hi,
i need to create a nested tables for example:

https://datatables.net/release-datatables/examples/server_side/row_details.html

when i open row detail i need to create second table inside with sever-response information (ajax call when i click on image)

how i can do?

thx
Alex

Replies

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

    > oTable.fnOpen( nTr, fnFormatDetails(nTr), 'details' );

    Just initialise the new table like you would any other table. Its in the DOM, so you can do whatever you want with it - including making it into a DataTable.

    Allan
  • ITARulezITARulez Posts: 10Questions: 0Answers: 0
    Thx Allan all work fine! i have only one problem...i have 3 tables
    table -click-> row -open-> table -click-> row -open->table

    but every so give me a problem:

    DataTables warning (table id = 'secondInnerTable'): Cannot reinitialise DataTable.

    To retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy

    why?
    thx
    Alex
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Its because, as the error message says, you are trying to reinitialise a table that already exists and you can't do that - it isn't supported. The answer is to simply not reinitialise tables which are already DataTables.

    Allan
This discussion has been closed.