DataTables / RowGroup

RowGrouping extension for DataTables
Other
30 stars 24 forks source link

data-filter on a grouped row stops grouping from working #4

Closed psylenced closed 7 years ago

psylenced commented 7 years ago

Created jsfiddle demonstrating issue here:

https://jsfiddle.net/xhcd193m/

When a cell has a <td data-filter="A"> on it (for searching), the rowGroup does not work when trying to group by that column.

https://github.com/DataTables/RowGroup/blob/f1abc536df6b191ba210a35c15598e11d1aea1df/js/dataTables.rowGroup.js#L218

The line above seems to read the filter value rather than the cell data.

DataTables commented 7 years ago

Its because you are using orthogonal data read from the DOM. You need to set rowGroup.dataSrc to be "2.@data-filter" which is where DataTables reads the orthogonal filter data into: https://jsfiddle.net/xhcd193m/1/ .

In future, could you post support requests to the DataTables forums, as noted in the New issue template text? That allows everything to be searchable in one location.

psylenced commented 7 years ago

Hi,

The above fix does not resolve the issue as it uses the search filter and not the cell data for the grouped headings.

What is the value for the dataSrc to read the cell content for group headings, while still being searchable by using the data attribute?

DataTables commented 7 years ago

Oops - sorry. 2.display: https://jsfiddle.net/xhcd193m/2/