jQuery Datatables rowGroup Collapse/Expand

后端 未结 4 1578
无人及你
无人及你 2021-01-03 04:44

I\'m using jQuery Datatables and I would like to incorporate row grouping into the table.

I have attempted to incorporate it myself by adding rows and a click event

4条回答
  •  走了就别回头了
    2021-01-03 05:17

    My quick and dirty solution is this...

    $('.group').click(function() {
        //$(this+" .group_date .date_arrow").addClass("rotateSVG");
        var nextItem = $(this).next('tr');
        while(nextItem.attr('class') != 'group') {
            nextItem.fadeToggle();
            if(nextItem.next('tr').length == 0) {
                break;
            }
            nextItem = nextItem.next('tr');
        }
    });
    

提交回复
热议问题