Auto-Expanding multiple groups
Auto-Expanding multiple groups
codemonkey65
Posts: 14Questions: 3Answers: 0
I have a datatable that has a dynamically created group name. Each group is a week number from 1 to 52 potentially. I will never show all 52 weeks of data but there will be times when many weeks need to be seen. My problem is the bExpandableGrouping property. In order for this to work with all groups, pagination must be turned off, so this method will not work for me. The solution is to set asExpandedGroups: ["WEEK: 1", "WEEK: 2", "WEEK: 3", etc.] I would prefer not to have to hard code all of my group names if it can be avoided. Is there another solution I can use to show all groups without turning of pagination?
My table definition is as follows:
var table = $('#grdLoadingData').dataTable({
"bLengthChange": false,
"bPaginate": true,
"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,
"sScrollY": 600, //height
"bScrollCollapse": true,
"aoColumns": [
{ "sTitle": "MC #", "sWidth": "40px" },
{ "sTitle": "Order #", "sWidth": "40px" },
{ "sTitle": "Site", "sWidth": "25px" },
{ "sTitle": "Seq. #", "sWidth": "15px" },
{ "sTitle": "GroupingValue", "sWidth": "0px" }
]
}).rowGrouping({
bExpandableGrouping: true,
asExpandedGroups: ["INSIDE LOAD COMPLETE", "INSIDE LOAD INCOMPLETE", "WEEK: 1", "WEEK: 39", "WEEK: 40"],
iGroupingColumnIndex: 53
});
My table definition is as follows:
var table = $('#grdLoadingData').dataTable({
"bLengthChange": false,
"bPaginate": true,
"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,
"sScrollY": 600, //height
"bScrollCollapse": true,
"aoColumns": [
{ "sTitle": "MC #", "sWidth": "40px" },
{ "sTitle": "Order #", "sWidth": "40px" },
{ "sTitle": "Site", "sWidth": "25px" },
{ "sTitle": "Seq. #", "sWidth": "15px" },
{ "sTitle": "GroupingValue", "sWidth": "0px" }
]
}).rowGrouping({
bExpandableGrouping: true,
asExpandedGroups: ["INSIDE LOAD COMPLETE", "INSIDE LOAD INCOMPLETE", "WEEK: 1", "WEEK: 39", "WEEK: 40"],
iGroupingColumnIndex: 53
});
This discussion has been closed.
Replies
Thanks for your help.