Option for different color scheme for active filters

  • 3
  • Idea
  • Updated 2 years ago
  • Under Consideration
Currently, there are different colors for toggle filters to show whether they are active.  It would be great if other filter types had similar functionality.  When a user comes back to a view (that uses saved filters), the active filters would be highlighted with a different color so they would know not all records are being displayed.

...paying attention to actual filter labels can be a lot to ask :)
Photo of Jared Jones

Jared Jones

  • 2,214 Points 2k badge 2x thumb

Posted 2 years ago

  • 3
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
I actually Had asked a similar question months ago.

See Emily's last post on a possible solution. I had not tried it as me and custom code are not good friends :D

If you or anyone  ever make it work, I would appreciate being shared the code

https://community.skuid.com/skuid/topics/selected-filter-css-change
Photo of Jared Jones

Jared Jones

  • 2,214 Points 2k badge 2x thumb
Thanks, Dave.  I appreciate the link.  Unfortunately, that approach would use the text of the filter label instead of the filter state itself.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I threw this together in the console. It's very hacky, but it should get you started:

skuid.$.each(skuid.$('#myTable .nx-conditiontoken'),function(i,obj){console.log(skuid.$(this).data());
if(skuid.$(this).data().component && skuid.$(this).data().component.list && (!skuid.$(this).data().component.list.selectedKey || skuid.$(this).data().component.list.selectedKey === "__reset")) skuid.$(skuid.$('#myTable .nx-conditiontoken')[i]).addClass('disabled');
if(skuid.$(this).data().originalValue && !skuid.$(this).data().originalValue.end && !skuid.$(this).data().originalValue.start) skuid.$(skuid.$('#myTable .nx-conditiontoken')[i]).addClass('disabled');
});
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
this assumes you have a table with the unique id "myTable"
Photo of Jared Jones

Jared Jones

  • 2,214 Points 2k badge 2x thumb
Hi Matt,

Thanks for taking the time to put this together.  It was pretty cool to load the page and see all of the filters with the same faded look of an inactive toggle.  Looking forward to working out the rest and sharing the result...I'm sure I'll have questions along the way.



Thanks again!
Jared
(Edited)
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,220 Points 5k badge 2x thumb
Jared~

Hopefully you'll be able to use what Matt provided above. Thanks for suggesting this, we'll bring it to the devs for consideration on a future release.

Thanks!
Karen
Photo of Jared Jones

Jared Jones

  • 2,214 Points 2k badge 2x thumb
Thanks, Karen.  It would be great to have this as a declarative option.