@ceolter
Niall,
I haven't seen any issue logged for this, so I'm asking here.
I have a use case that requires me to toggle between two views/versions of a grid:
I have looked through all of the documentation and examples that I can find, and can't see a clear way of doing this. The ideas I've had are:
a) Use some sort of filter that passes only if the node has selected: true. However, I don't see any capability for applying an arbitrary filter to a dataset, i.e., a filter that hasn't been set in a columnDef; and, I don't see how a column filter can be applied to, or would make sense for, a checkbox selection column.
b) Extract the selected nodes from the original datasource using gridOptions.api.getSelectedNodes(), and then use these rows as the data for an alternate datasource, for the case #2. This seems to have some issues though, since I'm not clear if getting the selection will do the right thing for a virtual data source.
Can you provide some guidance? This seems like it should be straightforward, but I'm not finding the required pieces in the APIs.
Thanks,
Don
use external filtering like this:
var gridOptions = {
columnDefs: columnDefs,
doesExternalFilterPass: function(node) {
return node.isSelected();
},
isExternalFilterPresent: function( ) {
return true;
}
};
i didn't test, maybe i have a typo, but with the above, you should figure it out
use external filtering like this:
var gridOptions = { columnDefs: columnDefs, doesExternalFilterPass: function(node) { return node.isSelected(); }, isExternalFilterPresent: function( ) { return true; } };i didn't test, maybe i have a typo, but with the above, you should figure it out
At one case your solution won't work. If you set columns as 'selected' with 'cellRenderer' the filter won't see if the column was selected as filter runs before 'cellRenderer'. Therefore, decision needs to be made on some other data than node.isSelected().
Can we add it in custom filters?
Most helpful comment
use external filtering like this:
i didn't test, maybe i have a typo, but with the above, you should figure it out