bug with table in table ?
bug with table in table ?
grobob
Posts: 13Questions: 0Answers: 0
i want to use dataTable on a table which contain hidden table in each row like this :
...
...
...
subdata...
...
...
subdata...
Seem to not work. (1.5 beta 5)
Any idea ?
...
...
...
subdata...
...
...
subdata...
Seem to not work. (1.5 beta 5)
Any idea ?
This discussion has been closed.
Replies
It should work. I've just tried a test with nested tables and it seems to do the job okay. Do you have a link you could post showing the error?
Thanks
Allan
http://lotro.fr/bdd/test
I got an error, so i suppose i'm doing something wrong (i have no js error on the true url... but more complex)
Thanks very much for the link. Makes debugging much easier! The issue was in the selectors that I use for tbody, and that your tables use a tbody element. The two were getting mixed together, which resulted in a very confused DataTables... I've fixed this in my development version which I'll be releasing as beta 6 shortly.
Allan
Allan
Wonderful, wonderful, wonderful plugin! Thanks very much, sir.
I am trying to show a table within a table, and the inner table currently contains both a thead and a tbody tag. It seems to break if the thead tag contains th tags, with the following error:
Error: oSettings.aoColumns[iIndex] is undefined
Source File: jquery.dataTables.min.js
Line: 411
I can prevent the error by using td tags in place of the th tags.
Is there a remedy for this conflict that would allow me to use th tags in the table-within-a-table, or am I forbidden from having additional th tags anywhere?
snippet:
[code]
...
Name
Luis Zamora
...
[/code]
Thank you,
-Luis
Excellent catch - thank you for finding that bug. The problem was in the calculation algorithm used for determining the width of the column. bAutoWidth:false would get around this problem! I've got a fix, and it will be in the next release of DataTables. If you want to stick it into your local copy replace line 3755 ( "var oNodes = $("td", nCalcTmp);") with:
[code]
var oNodes = $("tr:eq(0)>td", nCalcTmp);
[/code]
And that should do the trick nicely.
I've also taken the opportunity to put a couple of other checks in for inner tables, to make sure they don't confuse DataTables :-)
Regards,
Allan
Thank you kindly,
-Luis
It should be:
[code]
var oNodes = $("tr:eq(1)>td", nCalcTmp);
[/code]
Otherwise the auto width calculation goes out the window...
Allan