Table filter validation

  • 1
  • Question
  • Updated 3 years ago
  • Answered
Hi All

We have a requirement where we have multiple filters on a table. out of all the table filters, we want two filters to be required and page throws an error if user has not selected value in these two filters. Problem is that these filters are multi select type and as soon as user clicks on apply button (in table filter), results are returned irrespective of whether user has selected any value or not.

I couldn't find an option in skuid and snippets to put a check on apply button in table filter. Is there any work around to achieve this?

Thanks.
Photo of Sunny Sharma

Sunny Sharma

  • 678 Points 500 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
In the Table properties — in the Filters and Search tab — there is a property "Apply Filters and Search Immediately".  If this is set to false,  the user will have to select an additional "apply" button after filters are set up or search terms are enterred.  I believe you will be able to trap this "Apply" event with your JS code and make your check / error messages there. 
Photo of Sunny Sharma

Sunny Sharma

  • 678 Points 500 badge 2x thumb
are you talking about apply button that renders on page when user changes any filter value?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Yes
Photo of Sunny Sharma

Sunny Sharma

  • 678 Points 500 badge 2x thumb
Okay. I do not see any option of overriding it. is it that we can access it from a skuid snippet on the basis of class or can we overwrite event listener for this button?

also, another thing is that since we have "Remember last-selected filter value", in order to load data on page load, we have to execute another snippet?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
There is nothing built in.  You will have to hack and find the dom element and trap the "On Click Event"   Not pretty, but possible.