Grouping Rows by Column like JQuery Accordion
Grouping Rows by Column like JQuery Accordion
To be clear, I am new to DataTables, and JQuery in general.
I have looked at the example "row_details" for awhile on the site,
and seemed to only find legacy matches containing "fnDrawCallback" or "fnOpen/fnClose."
What is different about mine is, the Table is already displayed on the website.
I was hoping to use DataTables for the manipulation of the table.
The data is already sorted, but would like the alteration specified:
A Student can have many Classes
So I would like a Row to just have the Student name,
and then each matching row with the same Student's name be hidden,
then expanded like in the "row_details" example.
There is no need to show the Students name again when expanded.
Does DataTables have the ability to scan thru a list of data, find and group by Student Name in an Accordion style?
I will drawn a table to be sure we are clear.
Currently:
Student1 | Class 1 |
Student1 | Class 2 |
Student2 | Class 2 |
Student2 | Class 3 |
Would like to look like..
| (+) Student1 |
| (+) Student2 |
And Visually look like this when expanded.
| (+) Student1 |
| (-) Student2 |
Class1 |
Class2 |
Any help on howto proceed would be greatly appreciated. Thank you in advance :)
Answers
How about this example?
Allan
Unfortunately to my understanding it does not, please let me know if wrong.
How can I allow grouping of rows based off of Student?
The "row_details" example only allows hiding of data per specific row.
I want the ability to have multiple duplicate rows of StudentX be grouped together into one, and then expanded to see all classes they would be taking like the drawing I did above.
Okay - thanks for the clarification. Row grouping in such a fashion is not something that DataTables supports at this time.
Allan