How to aply filter in cross selector

I cannot find any example how to use/set filter for filtering options items in cross selector .
Best regards,

Hi Goran,

I’ve been using cross filters recently. What do you need help with? Maybe I can help…


1 Like

In panel cross selector I have list of 180 countries. I would like to use filter, to write few letters and to show items that satisfy the filter. For example if I have country list: [‘Austria’, Argentina’, ‘Canada’, ‘Australia’] and in filter I write ‘aus’ to show ‘Austria’ and ‘Australia’ and then only one of them to send in Selected items box.

Thanks in advance,

If you mean how to use the cross-selector gui, then here’s what I can offer:

The filter is actually a multi highlight, similar to selecting several items while holding Command or Control.

If you want to do just what you said in your example, then after the filter selects both Austalia and Austria you can simply select one of them with your mouse before clicking the right arrows to move them to the selected items box. You can also move them both to the right, and then return one of them to the left.

I recently had a similar long list of codes that I needed to let the user choose from. In my case, I used the left filter to select everything with the relevant keyword they need, e.g. index, click the arrows to move them to the selected box, and then I use the right filter to move select patterns in the selected box I want to remove, or the Command/Control+click to multi select items without a common pattern. Click the left arrows to move them back out to the list of not-selected options. In this case I didn’t connect the selected list to a dynamic widget. Instead I added a button that says “Apply country filter”, and in the button action function I use the CrossSelector.value.

I hope this helps. Let me know if you were looking for something else…

1 Like

@philippjfr I can contribute a better example for this in the docs.

Hi noatamir
Thanks for detailed description for possible solutions. I expect, may be I am wrong, when I write few letters in the Filter available option (above left box) and press Enter, automatically will be filtered countries names that satisfied the written criteria.The problem is that nothing is happened after i write few letters (nothing is selected).
Or maybe I should use filter_fn() parameter, but I don’t know how to use it.

1 Like