Drill Down Rows

Drill Down Rows

sskopniksskopnik Posts: 3Questions: 0Answers: 0
edited February 2011 in General
I'm looking for a drill-down table function: two typ of rows: master / detail rows. typ is defined by a special table column. Every master has some detail rows ordered below and hidden by default. They can be made visible by (double)clicking on the master.

Any idea which way to go? Any datatable feature usable?

Thanks

Replies

  • mstrandmstrand Posts: 24Questions: 0Answers: 0
    Does this example help?

    http://www.datatables.net/examples/api/row_details.html
  • sskopniksskopnik Posts: 3Questions: 0Answers: 0
    edited February 2011
    Not really, of course I found that example. This drilldown shows some 1 : 1 details of the selected row.
    I need Master-Detail rows = 1 : N: <=> 1 row is the master of a number of detail rows. Master and Detail have the same # of columns. The contents only differs in typ of aggregation or simly not filled. The master row controls it's detail rows: Show and hide the details. The contents of the whole table is read directly from a (temp) DB-Table which supplies the column to differenciate between master and datail row:

    Ex Table:
    [code]
    ID MASTER DESCR DATE NRUSERS DISTANCE WEATHER
    1 1 Im the Master 1 1.1.2011 7 sunny
    2 0 Detail1 of Master 1 5 56
    3 0 Detail2 of Master 1 2 70
    4 1 Im the Master 2 2.3 2011 10 rainy
    5 0 Detail1 of Master2 5 123
    ...
    [/code]
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    At this time fnOpen does not allow multiple rows to be added to the table. It simply appends an empty container cell to the table (in a suitable position) and allows you to put whatever you want into the now empty space. As such one option is to insert another HTML table with the same number of columns as your master table which will give the layout you want (you may need to use Javascript to equalise the column widths). Another option is to manipulate the DOM that is added automatically by DataTables (i.e. remove the TD, but keep the TR and add your own TD elements).

    fnOpen is something I'd like to look at improving in future - possibly opening it up with an API to provide greater flexibility in future. Any ideas for what you would require in this area would be much appreciated!

    Allan
This discussion has been closed.