Nested Tables

Nested Tables

chuckachucka Posts: 2Questions: 0Answers: 0
edited February 2010 in Bug reports
I would like to use a table inside a cell on a datatable for displaying an order's items. I'm not looking to do any sorting on this nested table, I just want to display the data as sorting is far more important by purchaser, date, location, and total cost. Would be nice to retain the filtering ability upon that cell's contents though. Anyway, my table looks similar to the code below. When I attempt to sort by either of the last two columns, it wrongly adds classes and sorts on the first (or second) of the nested columns instead of the neighboring parent column which I clicked the header for.

[code]


NameCityStateConfigurationsDate SubmittedQuote Total



Purchaser_Name
City
State



1
Item_Name
Item_Model


4
Item_Name1
Item_Model32


1
Item_Name3
Item_Model2324



Date_Submitted
$Price.00



[/code]

Replies

  • allanallan Posts: 57,300Questions: 1Answers: 9,127 Site admin
    Hi chucka,

    Inner tables should work no problem in DataTables. I've just put together a test page to check this: http://datatables.net/dev/inner_table.html . It appears to work as I would expect. Are you using DataTables 1.6.1? Could you put up a demo showing an example of it giving unexpected behaviour?

    Thanks,
    Allan
  • chuckachucka Posts: 2Questions: 0Answers: 0
    edited February 2010
    I have a similar issue when I use your example. I run Windows 7 and have the same results in Firefox 3.6, Opera 10.10, Chrome 3.0.195.33, and IE 8.0.7600.16385. When I click the header for column 5, cell A is given the "sorting_1" class which is never removed in further sort operations. Your example is sorting correctly though, my issue may have been that the last cell is a cost. In any case, I replaced the nested table with divs and spans now and I have it working again. Although it could be defeated with extra css, you might want to look into that highlighting issue.
  • allanallan Posts: 57,300Questions: 1Answers: 9,127 Site admin
    Oh yes! I see what you mean. Yup - that's certainly a bug. I'll have a look at fixing that for the next release.

    Regards,
    Allan
  • allanallan Posts: 57,300Questions: 1Answers: 9,127 Site admin
    Got a fix for this now (which actually to a slightly performance improvement) and I'll include it in the soon to be released 1.6.2.

    Regards,
    Allan
This discussion has been closed.