Monday, 30 September 2013

How to populate select options dynamically from Model Collection

How to populate select options dynamically from Model Collection

I have a model as defined below class Colors extends Backbone.Model name:
-> [@get("name")] value: -> [@get("value")]
Collection as defined below class @ColorsCollection extends
Backbone.Collection model: Colors
Select tag as define below %select{name: "colorslist" type: "hidden"
value: "" }
Upon an event, I want to dynamically populate the colors select options
with data fetched from ColorsCollection.
I have been looking into select2 documentation but unable to find any
relevant examples.

No comments:

Post a Comment