guggenheim.js
guggenheim.js copied to clipboard
Example of filters using class and classes
Any chance of a demo showing filtering by class and/or classes in addition to your filter function demo?
Mike
Hey, unless I'm misunderstanding what you want, the filter function on the examples page is actually filtering by classes. All the function is doing is collating which classes we want to filter by from the inputs and passing them to guggenheim, which then filters by them.
Sorry I was not clear. I was a bit confused about how to set up the filtering in a way other than using checkboxes or radio buttons. I figured out how to use jQuery select2 and classes to filter items.
Is there an way to set up a filterFunction to use a input field to search for text used in a guggenheim-item to filter rather than using classes or checkboxes, etc. ?
You should be able to pass your own function to filter which will have each element passed to it in turn and use that to inspect the element. Bear in mind it will be the basic DOM element that gets passed so if you're using jQuery or something similar you'll need to convert the element to use jQuery methods on it.
As for hooking into the input field you should just be able to hook into the change event and have your event handler call the filter function and have your filter function grab the value from the input.
If you're still having problems let me know. I haven't actually tested that this will work, it's entirely based of theory and what the code's supposed to do :)