Datatables to nested HTML Tables

Datatables to nested HTML Tables

maverickreclcimaverickreclci Posts: 1Questions: 0Answers: 0
edited April 2013 in DataTables 1.9
I was working on a problem where a tool is generating a html dynamically and to make it a bit interactive i thought of using dataTables magic. With a good start , i got stuck in a problem -

The html is having nested tables (tables within tables) and my question is - Is there any way to subsume datatables on my html. I tried but it is giving an error - nCell is undefined .

What can i do about it ?
Sample html -
[code]

$(document).ready(function() { $('#table_id,#id2').dataTable();} );







AAA
gfff
fgfgf




Row 1 Data 1
Row 1 Data 2
etc


Row 2 Data 1
Row 2 Data 2
etc





sfdsfsdf
ffdfs




dzsfdfs
ddddddd








[/code]

Replies

  • nealsunealsu Posts: 4Questions: 0Answers: 0
    @maverickreclci did you find a resolution to this problem. I was wondering if it were possible to do the same thing. But I also get an error: "SCRIPT5007: Unable to get property 'className' of undefined or null reference ".

    I want to include my nested tables within the HTML rather than populate them on the fly.
  • nealsunealsu Posts: 4Questions: 0Answers: 0
    Actually just had a bit more of a search and this looks promising:

    http://datatables.net/forums/discussion/11354/expanding-rows-pulling-data-purely-from-tables/p1
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    In principle it works just fine. However @maverickreclci's code above doesn't have three cells on every row in the parent table. its missing two on the last row.

    Modified and running:
    http://live.datatables.net/iledox/edit#javascript,html

    Allan
This discussion has been closed.