Be able to apply filters from multiple filter sets at once - snippet in a button

  • 1
  • Question
  • Updated 4 weeks ago
  • In Progress
  • (Edited)
Since individual filters cannot be conditionally rendered, we have a page with multiple filter sets. There's a basic set that are always there, but additional filtersets might show with different critieria. When a filter is applied, it can affect as many as 43 different models, so it can take a little bit of time. So, we are not applying filters immediately in case a user wants to apply multiple filters - when they hit apply there's a few seconds of wait time. 

However, with multiple filter sets, we can have multiple Apply/Cancel buttons. I can target these buttons to hide using display:none - but is there any code that will Apply filters from multiple filter sets at one time?

Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb

Posted 1 month ago

  • 1
Photo of Javid Igani

Javid Igani, Internal Solutions Engineer

  • 186 Points 100 badge 2x thumb
Hey there, Jack! I have two questions:
  1. Are you on version 11.2 or higher?
  2. Could you provide some details as to the need to affect up to 43 models? 
I'm mostly curious so I can understand if my initial thought will be useful.
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb
Yes on 11.2.9

It's a little complicated but I'll try and explain - we have a "scorecard" which is a table of Parent Object, each column is a period of time, and the values in the cells are the average or sum (depending on a user's setting for each Parent Object) of a child object for a given time period. The user can choose to show up to 25 months plus up to 13 quarters plus yearly rollups of 2018 through 2015 plus the Last 13 months rolling. So 43 models, all aggregate. 

Note that all the months and quarters are dynamically created via snippets, so they are only on the page if the user has settings that necessitate those. 

The filters are actually on a separate FilterModel, and there's a snippet that when the filter model is requeried, it checks each filter on the filter model and activates and sets values or deactivates the same conditions on each of the 43 models, then requeries those, which is querying up to 43 aggregate models. 

Thanks for responding Javid, and I'm interested in your initial idea, even if you don't think it will work, maybe it will point to something I haven't thought of!