List Manager Forum

Default filter

User Dean 2025-05-15 03:21:00

I've created a filter in a list. Within that filter are two options: Option 1, Option 2. I understand how to add that filter to my data layout settings and it works correctly. However, I'd like to apply one of those filter options by default when the list is initially displayed without actually selecting the option. Is there a method for accomplishing that?

Moonsoft support 2025-05-15 14:38:01

Hi,
there no such setting at the configuration, but you can create that function using a couple of lines of javascript at the js section. Please add to your toolbar the 'apply filter' button in case you don't have it, and use this code (you only need to replace FILTER_NAME and FILTER_VALUE for your own filter real names at the first 2 lines)

var filter="FILTER_NAME";
var valuefilter="FILTER_VALUE";
var toinit=true;
var _lmcallback = ').click();}toinit=false;})"];


Please give it a try and let us know If you need further help, also if you'd like to hide the 'apply filter' button if you use automatic filters.

Regards
Silvia Martín
Moonsoft Team

User Dean 2025-05-15 16:36:12

That worked great, thank you for your help.

...
List Manager

Build different lists for your site

Buy now!
...
Support/development 40 hours

With the peace of mind of having a professional team at your service (20% discount)

Buy now!