From what context to get select options source?
See original GitHub issueHi, i’m hoping to transfer from backbone.stickit to backbone.epoxy.
Mostly epoxy seems better to our needs.
But i’m trying to get a <select> filled.
in stickit i would do:
bindings:{
'#category': {
observe: 'category_id',
selectOptions: {
collection: function(){
return this.App.request('collection', 'frontofficemenu');
},
labelPath: 'name',
valuePath: 'id'
}
}
}
the this.App.request returns a collection i’d like to use.
Is there some way to do this in epoxy, including the labelPath and valuePath options set per view? maybe through a custom handler?
Issue Analytics
- State:
- Created 9 years ago
- Comments:7
Top Results From Across the Web
<select>: The HTML Select element - HTML - MDN Web Docs
Each <option> element should have a value attribute containing the data value to submit to the server when that option is selected.
Read more >jQuery Get Selected Option From Dropdown - Stack Overflow
If you are in event context, in jQuery, you can retrieve the selected option element using : $(this).find('option:selected') like this :
Read more >SuiteScript 2.x: Suitelet > Select field that sources the options ...
In a suitelet, there is a method called formField.addSelectOption that allows you to set the static select options for the select field.
Read more >How to get Select Options in Template from Attribute Source ...
I created all the needed files but i don't know how to get the options (created in source model) in the template file....
Read more >Options picker - Budibase Docs
First, select. Data Provider as the options source in the Settings Panel. 512. Next, there are 3 selections to be made in the...
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 Free
Top 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

Is there anything preventing you from creating and fetching your map and then just pass the resulting collection to Epoxy? Like this:
That way you only ever have one instance of the collection, it’s already fetched and everything. Don’t worry about it being loaded or not, all Epoxy views bound to it will instantly refresh as soon as it will be done fetching.
Totally agreed, but I’m not sure if it can be implemented in the current state. The way
optionsDefaultandoptionEmptywork is already a bit hackish (they are hardcoded exceptions to the regular handlers map). I have no idea if the author is planning on making that possible or not. Maybe there’s a way to changeoptions:to accept an hash instead so we can so stuff likeoptions:{collection:$myOptions,label:'myNameField',value:'id'}likeevents:does.@maxpoulin64 yes
{options:$myOptions,label:'myNameField',value:'id'}this would be awesome.