0
votes

I'm using ag-grid in my angular project. One of my columns uses checkboxes for filtering and has a search bar and a select all checkbox. When the select all box is unchecked when you searched for something, only the items that match the search term are deselected instead of everything.

select all checkbox

This question was already asked on github : https://github.com/ag-grid/ag-grid/issues/1559. Here, the answer was given to set the selectAllOnminiFilter to false. However, in the changelog of ag-grid, it says the selectAllOnMiniFilter property is removed : https://www.ag-grid.com/ag-grid-changelog/ (key: AG-3383)

Is there a way to get this behavior without the selectAllOnminiFilter property?

1

1 Answers

1
votes

You should be able to get all nodes using

forEachNode((node, index))  

and then uncheck the node.

You could do it using the following

gridApi.forEachNode(node => node.setSelected(false));

According to documentation, this will not ignore any sorted or filtered nodes.

Iterates through each node (row) in the grid and calls the callback for each node. This works similar to the 'forEach' method on a Javascript array. This is called for every node, ignoring any filtering or sorting applied within the grid. If using infinite row model, then gets called for each page loaded in the page cache.