DataTables / RowGroup

RowGrouping extension for DataTables
Other
30 stars 24 forks source link

grouping duplicated #11

Closed malohtie closed 5 years ago

malohtie commented 5 years ago

Hi when im trying to group my data by column it working but i see a duplicate group i believe it a bug ? here is a screen shoot image

also my grouping code

rowGroup: {
                startRender: function ( rows, group ) {

                    console.log(rows);
                    console.log(group);
                    return $("<tr/>")
                        .append( "<td colspan=\"7\" align=\"center\">Entity : "+group.toUpperCase()+"</td>" );
                },
                endRender: null,
                dataSrc: "entity"
            },

when using console log it show me this

image

finally my json data

"data":[{"id":3,"username":"mohamed","full_name":"alami ahmed","role":"leader","is_active":true,"team":"none","entity":"sqsq","nb_logs":"0"},{"id":4,"username":"cvxcvxcv","full_name":"cxxcvxx","role":"mailer","is_active":true,"team":"hotmail","entity":"prosoft","nb_logs":"0"},{"id":1,"username":"admin","full_name":"Mohamed Amine","role":"admin","is_active":true,"team":"admin","entity":"prosoft","nb_logs":"4"},{"id":5,"username":"vbccvb","full_name":"cvbvcbcvb","role":"admin","is_active":true,"team":"admin","entity":"prosoft","nb_logs":"0"}]

ps version used : <script type="text/javascript" src="https://cdn.datatables.net/v/bs4/dt-1.10.18/b-1.5.6/r-2.2.2/rg-1.1.0/datatables.min.js"></script>

thanks

malohtie commented 5 years ago

Ok seem that i need to order by the same fields

image

order: [[3, "asc"],[4, "asc"]],
          rowGroup: {
                dataSrc: [3, 4]
            },