I have several ag grids I'm working with that are setup as Master/Detail. I have an external filter setup on the master and that works fine I can extend it to the detail grid but running into a couple issues:
- The filter appears to only apply to expanded nodes. Closing and reopening resets the data, though the filter may still have a value.
- I haven't figured out a way for the filter to ignore the master if the filter matches detail but not the master.
- How I expand the master where the detail matches. I think I will need to use a a timeout so that the grid isn't expanding and collapsing on each key press, but I don't know how to know which grid has matching data.
The code below is what I have so far for just handling the detail grid but this appears to be very slow (plunker: https://next.plnkr.co/edit/S1PNvugCbjPh55jI).
onFilterTextBoxChanged() {
// this.gridApi.setQuickFilter(document.getElementById('filter-text-box').value);
this.gridApi.forEachNode(function(node) {
console.log('node.detailNode', node)
node.gridApi.forEachDetailGridInfo(function(detailGridApi){
console.log('detailGridApi', detailGridApi);
detailGridApi.api.setQuickFilter(document.getElementById('filter-text-box').value);
})
});
}