How to group a set of group in datatables

How to group a set of group in datatables

vishal7488vishal7488 Posts: 13Questions: 5Answers: 0

I am looking for a way to group the set of groups. So for an example attached. I have two groups for CA and LT product class which is grouped based on product class. Now, I want if all the columns are having same value for CA and LT prod class, these will also be merged and looks like something in 3rd screenshot. showing product classes as ',' separated in Product class column in grouped row.

(https://datatables.net/forums/uploads/editor/6i/d5iucmd0xh3v.jpg "")


This question has an accepted answers - jump to answer

Answers

  • vishal7488vishal7488 Posts: 13Questions: 5Answers: 0

    And I am using rowGroup extension for grouping data for the first time based on product class.

    order: [
    [0, 'asc']
    ],
    rowGroup: {
    dataSrc: 'prodClas',
    startRender: function(rows, group) {
    return $('<tr/>')
    .append('<td colspan="13"><b>' + group + '<span display:inline-block; style="margin-right: 77.8%";> </span><button type="button" style="margin-left:0px;height: 200x;height: 23px;" class="btn btn-primary delete" id="delete">Add Term</button> </td>')
    .attr('data-name', group);
    }
    },

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    This example from this thread may help, it's doing something similar,

    Colin

  • vishal7488vishal7488 Posts: 13Questions: 5Answers: 0

    Thanks @colin

This discussion has been closed.