RowGroup not appearing on datatables

RowGroup not appearing on datatables

bmrobsonbmrobson Posts: 4Questions: 2Answers: 0

We've recently had to switch to datatables 2.0 while attempting to upgrade our project from Angular 14 to Angular 17. During this transition, we noticed a table that uses rowGroup is not working properly. No errors are shown, and there are no row groups displayed on the table.

I am adding rowGroup to our datatables object and setting dataSrc to 0, which is the column index we want to group by. This is consistent with the documentation, so I'm not sure what's going on.

Are there any breaking changes regarding versioning with datatables and rowGroups?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,342Questions: 26Answers: 4,954
    edited June 13

    Are there any breaking changes regarding versioning with datatables and rowGroups?

    No, RowGroup with 2.0 works in this example.

    I am adding rowGroup to our datatables object and setting dataSrc to 0,

    Are you loading the RowGroup library?

    upgrade our project from Angular 14 to Angular 17.

    Possibly you need to ask the Angular Datatables developers about this.

    Can you post a test case showing the issue so we can help debug?
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • bmrobsonbmrobson Posts: 4Questions: 2Answers: 0

    I've tried loading the RowGroup library, it still doesn't work.

    Angular Datatables doesn't officially support RowGroup, but it was working before the upgrade. Here's a test case:
    https://live.datatables.net/qixakufo/1/edit?html,css,js,console,output

  • kthorngrenkthorngren Posts: 21,342Questions: 26Answers: 4,954
    edited June 14

    The test case doesn't run properly. I would swap the order of the imports. Change:

    import 'datatables.net-rowgroup-dt';
    import 'datatables.net-dt';
    

    to

    import 'datatables.net-dt';
    import 'datatables.net-rowgroup-dt';
    

    This test case has rowGroup loading first and RowGroup doesn't work. Swap the .js load order and it will work:
    https://live.datatables.net/lafazujo/1/edit

    This suggests that RowGroup has a dependency on datatables.js loading first.

    Kevin

  • bmrobsonbmrobson Posts: 4Questions: 2Answers: 0

    Ive tried it both ways. Also, looking at the example you provided, it doesnt seem to be working there either, at least not for me

  • kthorngrenkthorngren Posts: 21,342Questions: 26Answers: 4,954
    Answer ✓

    Sorry, I guess I wasn't clear on how to make the test case work. Here is the same example with the datatables.js and rowgroup.js lines swapped.
    https://live.datatables.net/lafazujo/4/edit

    Use the debugger to see if RowGroup is loaded on your page. Post your Datatables init code, maybe there is a typo your not seeing. Do you get errors in the browser's console?

    Kevin

Sign In or Register to comment.