Two Level Row Grouping

Two Level Row Grouping

codemonkey65codemonkey65 Posts: 14Questions: 3Answers: 0
edited September 2013 in DataTables 1.8
I know it is possible to create two level grouping and I have been successful in doing this. My question is this: Is it possible for the second level of grouping to be done conditionally? I have several different views that I display my datatable in and I only want the second tier of grouping to appear for a specific view. Is this even possible? My rowgrouping code currently looks like this:

var table = $('#grdLoadingData').dataTable({
"bLengthChange": false,
"bPaginate": xPagimg,
"sPaginationType": "full_numbers",
"aaData": records,
"sDom": "T<'clear'>lfrtip",
"oTableTools": {
"sRowSelect": "multi",
"sSwfPath": "../../scripts/jquery/media/swf/copy_csv_xls_pdf.swf",
"aButtons": ["print"]
},
"bAutoWidth": false,
"sScrollX": xScroll,
"sScrollXInner": xScroll,
"sScrollY": 600, //height
"bScrollCollapse": true,
// The fnRowCallBack designation here will change the text color of a row in the datatable based on the content of the Order Status
"fnRowCallback": function (nRow, aaData) {
if ($('#ddlViews').val() == "MC" || $('#ddlViews').val() == "MCL" || $('#ddlViews').val() == "MCD") {
if(aaData[58] == "FALSE") {
jQuery('td:eq(53)', nRow).addClass('deliveryDateRequested');
} else if (aaData[58] == "TRUE") {
jQuery('td:eq(53)', nRow).addClass('deliveryDateScheduled');
}
}
},
"fnHeaderCallback": function (nHead) {
$(nHead).closest('thead').find('W/SYS').each(function () {
if ($('#ddlViews').val() == "MC") {
$(nHead).closest('thead').html('PARTS ORDERS');
}
});
},
"aoColumns": [
{ "sTitle": "Priority", "sWidth": "5px", "fnRender": function (oObj) {
return '';
}
}, // Column 0
{ "sTitle": "BTO", "sWidth": "5px", "fnRender": function (oObj) {
var checked = "";
if (oObj.aData[1] == "X") checked = 'checked="checked"';
return '';
}
}, // Column 1
{"sTitle": "MC #", "sWidth": "40px" }, // Column 2

...

{"sTitle": "GroupingValue", "sWidth": "0px"}, // Column 60
{"sTitle": "Started", "sWidth": "5px", "fnRender": function (oObj) {
var checked = "";
if (oObj.aData[60] == "X") checked = 'checked="checked"';
return '';
}
}, // Column 61
{"sTitle": "MatchedSequence", "sWidth": "0px" }, // Column 62
{"sTitle": "GroupingValue2", "sWidth": "0px" } // Column 63
]
}).rowGrouping({
bExpandableGrouping: true,
asExpandedGroups: uniqueGroups,
iGroupingColumnIndex: 60, //GroupingValue
iGroupingColumnIndex2: 61
});

This works fine but I would like to only use iGroupingColumnIndex2 if a specific view is being requested. Is this possible?
This discussion has been closed.