When grouping, the inscription "No group"

When grouping, the inscription "No group"

dwpointdwpoint Posts: 9Questions: 3Answers: 0

Hello. I am using DataTables from AdminLTE. Enabled the rowgroup plugin. added to initialization
rowgroup: {
dataSrc: 2
},
Next, I get the data via a query and populate the table via table.rows.add(...).draw()
And at the top, after the headings, it just says No group.

Next I tried to follow the following:
1. I removed "rowGroup": {
dataSrc: 2
},
2. Received data via Ajax and filled in the table in the same way.
3. Tried to run the following code:
let table = $('#myTable').DataTable();
table.rowGroup().enable();
table.rowGroup().dataSrc(2);

In response, only in the console is given context: Array (0) ...

What am I doing wrong?

Answers

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736

    That will happen if you are using columns.data with object row data. In this case you need to use the object key not row index. Like this:
    https://live.datatables.net/dodobuge/11/edit

    Kevin

Sign In or Register to comment.