variable columns and a collapsible row grouping

variable columns and a collapsible row grouping

bigdaddyvbigdaddyv Posts: 29Questions: 0Answers: 0
edited May 2011 in General
I am looking for examples for an interface I need to build that allows me to show varying numbers of columns per row grouped together into collapsible groups. ie: let's say I am showing all the books in my library in this table. Some books would be in the children section. In that section I want to show 5 columns of data. Other books maybe in the gardening section. I want to show 9 columns of data for the gardening section.

The user would be presented with two rows of data... "children" on row #1 and "gardening" on row #2. Upon expanding one or the other, the rows for that grouping would be shown. Both (or more) groups could be expanded at the same time.

Any suggestions on how best to accomplish this task?

Thanks so much! I love datatables!!!

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    There isn't a build in method for changing visible columns in a atomic operation - but you could just call fnSetColumnVis as you need on each of the columns - thus manually defining the grouping. That means then that you can make the grouping exactly as you need.

    Allan
  • bigdaddyvbigdaddyv Posts: 29Questions: 0Answers: 0
    Actually I handled it differently... I built the grouping table and based on the groups they open, I use an ajax call to create another DataTable in a previously hidden . ie: when they click on "garden" the hidden div directly beneath that row is expanded and a new DataTable is created in it. Works pretty well. I should have it finished in a day or so and will throw you some sample code if you like.
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Sounds great - thanks :-)

    Allan
  • robberronesrobberrones Posts: 4Questions: 0Answers: 0
    This sounds exactly like what I need. Can you please provide a sample on the forum.
This discussion has been closed.