Group/Rowspan using data from data attribute as source

Group/Rowspan using data from data attribute as source

jithinwilfredjithinwilfred Posts: 4Questions: 1Answers: 0
edited July 2019 in Free community support

Is it possible to group based on data attribute (such as data-group="subgroup1") like that.
My requirement is to hide the group data on data attribute and show a different text on table cell

eg <td data-group="subgroup1">Subgroup</td>

please refer: https://datatables.net/forums/discussion/29319/new-rowsgroup-plugin-merge-cells-vertically-rowspan/p1

Thanks in advance

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    Answer ✓

    I answered on that other thread - no need to post the same question twice.

  • jithinwilfredjithinwilfred Posts: 4Questions: 1Answers: 0

    Thanks @colin

  • jithinwilfredjithinwilfred Posts: 4Questions: 1Answers: 0

    Consider a scenario when a class room contains 2 students named Peter and we want to show the sports played and corresponding rating, here we want to group by students name, but since the text (Peter) is the same the data table would group all Peter together

    Expected result

    Name                      Sport           Rating
    
                             Cricket            09
    Peter
                             Football           08
    
    
                             Cricket            07
    Peter                    Tennis             08
                             Hockey             09
    

    Actual Result

    Name                      Sport           Rating
    
                             Cricket             09
                             Football            08
    Peter                    Cricket             07
                             Tennis              08
                             Hockey              09
    

    @colin could you suggest any help. thanks in advance

This discussion has been closed.