backbone-forms icon indicating copy to clipboard operation
backbone-forms copied to clipboard

Suggestion Select editor setOptions() should also store them

Open robert2d opened this issue 10 years ago • 1 comments

When calling a Select editors setOptions() method it never actually stores these options on the field as an object.

Either you do this manually via editor.schema.options = "new options",

or you have to trawl through the actual dom and pick out the select editors options using jQuery this.$el.find("option") and then map of the values needed.

I suggest changing the setOptions method, to "re-set" the schemas options. This way you can pick the raw options off the editor when using event listeners etc.. Maybe a utility function for retrieving the selects options without hitting the DOM could be a part of the editor.

https://github.com/powmedia/backbone-forms/blob/master/src/editors/select.js#L52

robert2d avatar Nov 04 '14 00:11 robert2d

Sort of related to #274

philfreo avatar Nov 04 '14 00:11 philfreo