jquery datatables grouping doesn't group properly for column other than 0

jquery datatables grouping doesn't group properly for column other than 0

kasimbkasimb Posts: 4Questions: 2Answers: 1
edited April 2015 in Free community support
oTable = jQuery_1_11('#example').dataTable({
"searching": false,
"processing": true,
"serverSide": true,
"iDisplayLength": 20,
"sPaginationType": "full_numbers",
"language": {"infoFiltered": ""},
columnDefs: [{
        targets:grouprownum,
        "visible": false,
    }],
"ajax": {
    "url": "index.php?entryPoint=getTableData",
    "dataType": 'json',
    "pages": "5",
    "type": "POST",
    "data": function(d) {
        d.dbJson = sendJson
    },
    "dataSrc": function(response) {
        return response.aaData;
 
    }
},
"drawCallback": function(  ) {
 
    var api = this.api();
    var rows = api.rows({page: 'current'}).nodes();
    var last = null;
    api.column(grouprownum, {page: 'current'}).data().each(function(group, i) {
        if (last !== group) {
            jQuery_1_11(rows).eq(i).before(
                    '<tr class="group"><td colspan="5">' + group + '</td></tr>'
                    );
            last = group;
        }
    });
}
 
})

the "grouprownum" is dynamic which sets properly. but don't know why if grouprownum is set to anything other than 0 , then the grouping is not proper.

please help

This discussion has been closed.