Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82266

jquery DataTables Row grouping trigger by select

$
0
0

Trying to show default ordering after initial whithout the grey grouping tr , then shows the group tr after one html select selected.

But the grouping is drawn by

                "order": [[1, 'asc']],
                "drawCallback": function (settings){
                var api = this.api();
                var rows = api.rows({ page: 'current' }).nodes();
                var last = null;

                api.column(1, { page: 'current' }).data().each(function (group, i) {
                    if (last !== group) {
                        $(rows).eq(i).before(
                            '<tr class="group"><td colspan="1">' + '<b>' + group + '</b>' + '</td><td colspan="5"></td></tr>'
                        );

                        last = group;
                    }
                });
            },

I tried rowGroup extension which didn't worked out.

I just wondering how can I triger the drawCallback or call some api to add the grouping <tr> after my select on 'change'.


Viewing all articles
Browse latest Browse all 82266

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>