[indexSelector] create widget
See original GitHub issueThis widget needs to be able to render this:
API
Given this html:
<div id="sort-results"></div>
And JavaScript:
instant.addWidget(
instant.widgets.indexSelector({
container : "#sort-results",
indices: [{
name: 'index', label: 'Relevance'
}, {
name: 'index_priceASC', label: 'Highest price'
}, {
name: 'index_priceDESC', label: 'Lowest price'
}]
})
);
We render:
<select>
<option value="index">Relevance</option>
<option value="index_priceASC">Highest price</option>
<option value="index_priceDESC">Lowest price</option>
</select>
Options
container
string or DOMElementindices
array of objectscssClass
string (comma separated list of css classes to apply to root element)
Behavior
The selected index is the one set in the helper as the current one.
If the selected index is not one from the list, then we should throw an error.
Issue Analytics
- State:
- Created 8 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
jupyter-widgets/Lobby
I have used pyplot to create a figure with a legend. By default, the legend is framed. So my question is: how do...
Read more >Selectors
IndexSelector selects the elements closest to an abcissa; LassoSelector selects elements in a region drawn by the user. How they work. bqplot Selectors...
Read more >Add widget from python to a specific widget depth.
In your python file, you just need to import and create an ObjectProperty to reference the widget. #With your other imports
Read more >Use a Custom Widget as a Selector
When an out-of-the-box MicroStrategy widget is added to a document, it can be used as a selector that targets other controls in the...
Read more >instantsearch.js
instantsearch.js is a library of widgets to build high performance ... searchBox; stats; indexSelector; hitsPerPageSelector; pagination ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To provide a higher level of customization for this widget, we should enhance it.
So that people could pass their own template (so that they can use bootstrap dropdown components for example).
For this, we only need to provide an API to the instantiated widget, something like:
But I do not know how it will play with react and how to bind the events in it. Maybe that’s not the good way to do it.
For people wishing to use complex switch widgets like bootstrap widgets we should put this in userland (= do the widget ourselves in another repo, or let the community do it).
If you agree with this I will open another issue with this enhancement.
Do we have use-cases where an implementation uses this kind of widget for something else than sort order?