Expand and Collapse Rows

Expand and Collapse Rows

mdcookmdcook Posts: 7Questions: 0Answers: 0
edited July 2009 in General
Hi Allan,

I am designing the next tool for our website and would like to continue using DataTables to display our RNA sequence data. To make the tool more user friendly I would like to organize the data by making each row a "Sample" and then if the user chooses to expand a Sample every Sequence belonging to that Sample would appear below as new rows.

Right now I am going to make it so that every sequence will appear in the table and have a column for Sample Name and a column for Sequence Name. It would be nice if I could collapse a Sample, so that just the Sample Name was present and the Sequence Name column was blank.

I don't know if I explained that clearly or not?

Thanks for all you help so far!

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    edited June 2015
    Hi mdcook,

    Is this the kind of thing you are looking for: http://datatables.net/examples/api/row_details.html ?

    Thanks,
    Allan
  • mdcookmdcook Posts: 7Questions: 0Answers: 0
    Yes and no. When expanded each sequence would need to be a selectable row.

    The table is for displaying samples/sequences within a researchers "sandbox" for analysis. So if they only want to run a classification tool on specific sequences within their sandbox, they need to be able to select only them.
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Ah I see. Okay - can you just add an event handler to the opened row which will deal with the user selecting it? (something a bit like this for example: http://datatables.net/examples/example_select_row.html ). One thing to note - when fnClose() is called the details row is destroyed. Therefore it would probbaly be best to add the selected indicator to the parent row (i.e. like my example). So the long and sort would be combine those two examples, and the option to select a row would be done by something in the child row. How does that sound?

    Allan
  • mdcookmdcook Posts: 7Questions: 0Answers: 0
    Cool! It's possible. I will figure it out. Thanks a bunch!
  • klexicoklexico Posts: 3Questions: 0Answers: 0
    I'm trying to do something very similar to the OP, but I'm wanting grouping as well. I currently have row_select and grouping working, but I'm having a hard time trying to figure out how to get the group row to act like "row_details."

    In other words, I want my datatable to start off with all groupings collapsed with a "+" sign next the grouping name and I when I click on the plus sign the grouped rows expand/appear.

    Is this possible?

    If so, I'm not sure where to do the event handling. Do I create a new event handler or do I work it into where the grouping is created? I've tried adding an event handler to toggle the siblings, but it's not working and not sure where else to head next. Apologies for my beginner jquery skills.
  • lucasnplucasnp Posts: 18Questions: 0Answers: 0
    I am wondering the same question as Klexico. Grouping rows is nice, it's even nicer if we can expand/collapse it.

    Is it possible, Allan?
  • mftdorsmamftdorsma Posts: 1Questions: 0Answers: 0
    +1 for this feature. This would be great. There's a similar feature in http://www.smartsheet.com/
  • ahmadassafahmadassaf Posts: 3Questions: 0Answers: 0
    it would be erally nice to have a feature similar to the tree grid presented here
    http://www.jeasyui.com/demo/index.php
This discussion has been closed.