Hi guys,
I am using the MultiCheckboxFacet for facet . By default it allows us to select multi chekboxes for filtering results, but i have some situation that i only wanted to allow single selected checkbox. i.e
After click on second checkbox , first should be remove and results should be filter as per selected checkbox value.
Please suggest the best way to do this
It sounds like you are using search-ui. If you only want to allow users to select a single facet option, I recommend changing the view you use to SingleLinksFacet
.
import { SingleLinksFacet } from "@elastic/react-search-ui-views";
<Facet ... view={SingleLinksFacet} />
Thanks for your response, Yes i am using search-ui, but as per my requirement i want check boxes with single select. SingleLinksFacet not allow checkboxes and also rest options will hidden when we select any value. Please suggest if i am wrong.
In that case you'll need to create a custom view. I'd recommend using the MultiCheckboxFacet as a base (meaning copy and paste the code over to your custom view) and then customize it as needed: https://github.com/elastic/search-ui/blob/master/ADVANCED.md#component-views-and-html
Sure, Thanks for the information
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.