active_filters | Map incoming controller parameters to named scopes | REST library
kandi X-RAY | active_filters Summary
kandi X-RAY | active_filters Summary
Map incoming controller parameters to named scopes in your models
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of active_filters
active_filters Key Features
active_filters Examples and Code Snippets
Community Discussions
Trending Discussions on active_filters
QUESTION
I have a bunch of checkboxes that represent filters, so when clicking a checkbox it should add an object containing the type of filter (taxonomy) and the value (terms) to a filter array.
When clicking the checkbox it first adds a new object containing a taxonomy and terms property. So far this works. The problem is when i click a third checkbox that has an taxonomy value that already exists, it adds a whole new object to the array instead of adding the term to the already existing term array.
This is what it looks like right now:
...ANSWER
Answered 2020-Sep-14 at 07:26I created a workable example of your code, but changed the let tax = $(this).attr('id')
to let tax = $(this).attr('name');
.
So far, everything works as you expect, terms are added to the existing object instead of a new object being created:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install active_filters
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page