Bit of an odd one...
I have the collection:
class Store.Collections.Product extends Backbone.Collection
url: '/api/products'
model: Store.Models.Product
With the view:
class Store.Views.Origin extends Backbone.View
initialize: ->
@collection = new Store.Collections.Product()
@collection.fetch()
@model.bind('change:formatted', @render, this);
@render()
events:
'change [name=origin]': 'setOrigin'
el: =>
@options.parent.$('.origin-input')[0]
template: JST["backbone/templates/shapes/product"]
render: ->
$this = $(this.el)
$this.html(@template(model: @model.toJSON(), errors: @model.errors))
console.log(@collection)
@collection.each(@appdenDropdown)
@delegateEvents()
this
appdenDropdown: (product) ->
console.log("append trigger")
#view = new Store.Views.Products(model: product)
#$('#history').append(view.render().el)
with the template:
<div id="history"></div>
The collection works... the
console.log(@collection)
shows the data! however
@collection.each(@appdenDropdown)
Does not do anything, doesn't error, or through anything. It just doesn't do anything. I am trying to extract the data out of the collection! But it wont...