l-lin / angular-datatables

DataTables with Angular
https://l-lin.github.io/angular-datatables/
MIT License
1.58k stars 486 forks source link

Row Grouping #219

Closed marcostomazini closed 9 years ago

marcostomazini commented 9 years ago

exists as to the grouping component ?

https://datatables.net/examples/advanced_init/row_grouping.html

marcostomazini commented 9 years ago

Solved, sorry

.withOption('fnDrawCallback', function (oSettings) { .. https://datatables.net/examples/advanced_init/row_grouping.html

devlanp commented 9 years ago

Would you mind sharing the sample code of grouping ?

marcostomazini commented 9 years ago

Sample

.withOption('fnDrawCallback', function (oSettings) {
            var api = this.api();
            var rows = api.rows( {page:'current'} ).nodes();
            var last=null;
            api.column(2, {page:'current'} ).data().each( function ( group, i ) {
                if ( last !== group ) {
                    $(rows).eq( i ).before(
                        '<tr class="group"><td colspan="5">'+group+'</td></tr>'
                    ); 
                    last = group;
                }
            } );
}
devlanp commented 9 years ago

Awesome :+1:

devlanp commented 9 years ago

Anyway in which we can make it expandable/collapsible ?

marcostomazini commented 9 years ago

in my case I used the component

https://jquery-datatables-row-grouping.googlecode.com/svn/trunk/customization.html

EpokL commented 8 years ago

The link is not available. Can give me some example ?