Filter plugin modification

Tags: #<Tag:0x00007f8b18d473a8>

Hi,
Is there any way to modify the filter plugin logic?
for example if i want to filter column by my own logic how can I do it. Can you provide any example.
(I want to hide rows based on some flags when i apply filters on that) or (when any filter is applied i want to do some more checks on that before hiding)

Can I add my own condition here like filterPlugin.addCondition(index, ‘customCondtition’, value)

Thanks in advance

Hi @nihalshetty48

Filters themselves are a fixed set of conditions. But you can create a custom dropdown menu option. Here http://jsfiddle.net/AMBudnik/5ob8drut/ you can see what the construction of the object-defined dropdown menu is. And here https://handsontable.com/docs/context-menu/#context-menu-with-fully-custom-configuration in the Context menu with fully custom configuration paragraph we have a detailed explanation (along with a demo) of keys within a custom menu option.

Thanks for the reply, Can i modify filtered rows array and unhide some rows based on some conditions?
For example, after filter if only first row meets the filtered condition and is shown, can we do something on afterFilter so that i can enable any other rows

Sure, there’s a hook called afterFilter() it can be used to reattach another filter. You’d just need to add an IF that blocks the infinite loop from runing.