Trying to regroup a preloaded dataTable

Trying to regroup a preloaded dataTable

fanskfansk Posts: 2Questions: 0Answers: 0
edited March 2014 in General
Hello - I am trying to implement the rowGrouping plug-in for one of my JSF pages. The requirement is to do grouping on different columns (made available through a select box). I tried using fnDestroy() and fnClearTable(), before calling the rowGrouping and it doesn't work. Here is my js code :

$(document).ready(function() {
$('#displayWLTable').dataTable().rowGrouping({"bDestroy": true});
});

function callGroupByField(){
var selectedgroupByField = ($("#groupByField").val());
if (selectedgroupByField == 'contract'){
$('#displayWLTable').dataTable().fnClearTable();
$('#displayWLTable').dataTable().rowGrouping({
iGroupingColumnIndex: 3,
sGroupingColumnSortDirection: "asc"
});
}
}

my xhtml table code :















Due: 






























By default the display is grouped by the first column (Label). Now when I select, "Contract" in the select box, the display should get groupeded by Contract column. I am sure, I might be missing something trivial. Can you please help.

Replies

  • fanskfansk Posts: 2Questions: 0Answers: 0
    Hi folks, any insight. I am still stuck with this. I tried using fnDrawCallBack() to do the grouping instead of using the rowGrouping plug-in but encounter similar behavior. That doesn't work either.
This discussion has been closed.