Counting entries under a grouped row
Counting entries under a grouped row
andrea5917
Posts: 1Questions: 1Answers: 0
Hello.
I currently have a table extremely similar to the table found here. https://datatables.net/examples/advanced_init/row_grouping.html
Does anybody know of a way to count the number of entries under each group? In this example, it would counting be the names of the people under the city group.
This discussion has been closed.
Answers
In the linked example you provided, add logic to the
drawCallback
Now please note that
drawCallback
is called after every filter, sort, pagination. So if you only want this logic performed once, say after DataTable inialization and default sort applied to the city column, then seeinitComplete
or simply add it after your .DataTable() call.