-
Notifications
You must be signed in to change notification settings - Fork 488
Row grouping #86
Comments
You need to call the $scope.dtOptions = DTOptionsBuilder.fromSource($scope.URL)
.withPaginationType('simple_numbers');
$scope.$on('event:dataTableLoaded', function(event, loadedDT) {
// loadedDT === {"id": "foobar", dt: oTable}
loadedDT.dt.rowGrouping({
iGroupingColumnIndex:5,
sGroupBy: "year",
bHideGroupingColumn: false
});
}); |
Thanks for quick response! I still problem with it. My complete code: $scope.dtOptions = DTOptionsBuilder.fromSource($scope.URL).withPaginationType('simple_numbers');
$scope.dtColumns = [
DTColumnBuilder.newColumn('aa').withTitle('aa'),
DTColumnBuilder.newColumn('bb').withTitle('bb'),
DTColumnBuilder.newColumn('cc').withTitle('cc'),
DTColumnBuilder.newColumn('dd').withTitle('dd'),
DTColumnBuilder.newColumn('ee').withTitle('ee'),
DTColumnBuilder.newColumn('ff').withTitle('ff'),
DTColumnBuilder.newColumn('gg').withTitle('gg'),
];
$scope.$on('event:dataTableLoaded', function(event, loadedDT) {
loadedDT.dt.rowGrouping({
iGroupingColumnIndex:3,
sGroupingColumnSortDirection: "asc",
iGroupingOrderByColumnIndex: 0
});
}); And error from the console: |
Looking at the datatables-row-grouping source code, it seems that DataTable rowGrouping is only working with I made a Plnkr that seems to work. |
Thanks, I used your example, it works great. Is version 0.2.1 ready to use in our example or should I use v0.1.1? |
v0.2.1 is not out yet. So either you use v0.1.1 or the dev branch version. $scope.$on('event:dataTableLoaded', function(event, loadedDT) {
// loadedDT === {"id": "foobar", "DataTable": oTable, "dataTable": $oTable}
// loadedDT.DataTable is the DataTable API instance
// loadedDT.dataTable is the jQuery Object
// See http://datatables.net/manual/api#Accessing-the-API
loadedDT.dataTable.rowGrouping();
}); |
How can we group rows with angular 4 or later versions using this extension? |
Fetch your dtInstance and then call the datatableElement.dtInstance.then((dtInstance: DataTables.Api) => dtInstance.rowGrouping()); |
Hi Louis, Is I am using I logged |
The examples provided in this issue are for AngularJS, not Angular. Use this example to fetch your datatable instance: https://l-lin.github.io/angular-datatables/#/advanced/dt-instance |
Yes, following the same document. https://l-lin.github.io/angular-datatables/#/advanced/dt-instance I get the following for |
Hi Louis, Any hints here? |
The DataTable instance only returns the object created by DataTable. Check its API directly from datatables.net and check its RowGroup extension. |
Hi,
I'm trying to use rowgrouping mechanism included in datadables. How shoul I use it?
my code:
Living example in "clean" dataTable:
https://jquery-datatables-row-grouping.googlecode.com/svn/trunk/customGroupOrdering.html
Thanks for help
Best regards
The text was updated successfully, but these errors were encountered: