Datatables with rowGrouping unable to hide columns
Datatables with rowGrouping unable to hide columns
monkeytooth
Posts: 22Questions: 0Answers: 0
The JS:
[code]$(document).ready(function() {
// $( "#dashboard_container" ).tabs();
$('#orgListings').dataTable({
"bRetrieve": true,
"aoColumns":
[
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
]
}).rowGrouping({
iGroupingColumnIndex: 1,
sGroupingColumnSortDirection: "asc",
iGroupingOrderByColumnIndex: 0,
bExpandableGrouping: true,
bExpandSingleGroup: true,
iExpandGroupOffset: -1
});
});[/code]
The HTML:
[code]
Group IndexGroup Display Name
Organization
Volumes
Read (MB/s)
Write (MB/s)
Volume Size (GB)
My Cost (USD)
Comments
0Artful Scientific
Something Co.
information
0
0
0
$0
View
[/code]
The problem:
I am able to successfully do the row groupings and it works fine, however I have a need where I need to hide 2 of the columns to certain roles. As well as hide an additional column which would be the Equivlent of the "Organization" column which the grouping uses. However from the above JS you can see I have tried hiding all columns just to see if any would actually hide in my last ditch effort before coming here. No matter which ones all or one none will hide. Anyone know a work around for this? As I need the columns to remain but hidden to the actual view
[code]$(document).ready(function() {
// $( "#dashboard_container" ).tabs();
$('#orgListings').dataTable({
"bRetrieve": true,
"aoColumns":
[
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
]
}).rowGrouping({
iGroupingColumnIndex: 1,
sGroupingColumnSortDirection: "asc",
iGroupingOrderByColumnIndex: 0,
bExpandableGrouping: true,
bExpandSingleGroup: true,
iExpandGroupOffset: -1
});
});[/code]
The HTML:
[code]
Group IndexGroup Display Name
Organization
Volumes
Read (MB/s)
Write (MB/s)
Volume Size (GB)
My Cost (USD)
Comments
0Artful Scientific
Something Co.
information
0
0
0
$0
View
[/code]
The problem:
I am able to successfully do the row groupings and it works fine, however I have a need where I need to hide 2 of the columns to certain roles. As well as hide an additional column which would be the Equivlent of the "Organization" column which the grouping uses. However from the above JS you can see I have tried hiding all columns just to see if any would actually hide in my last ditch effort before coming here. No matter which ones all or one none will hide. Anyone know a work around for this? As I need the columns to remain but hidden to the actual view
This discussion has been closed.
Replies
Thank you.