I have something that should be very simple. I am creating a new collection, and I want to convey its visualization and add collection models to the page.
get_results: function () {
$ .getJson (this.url, function (response) {
this.search_results = new Kitchon.Collections.searchList (response);
console.log (this.search_results);
this.search_results.each (this.render_match);
}
},
render_match: function (model) {
console.log (model)
},
This returns an error
Uncaught TypeError: undefined is not a function
my collection has the usual structure
_byCid: Object
_byId: Object
_onModelEvent: function () {[native code]}
_removeReference: function () {[native code]}
length: 7
models: Array [7]
__proto__: o
I tried many things, but the one thing that stuck out was maybe I had to go through this.search_results.models.each(this.render_match); , since this is an actual array, but if I do, I get Uncaught typeError: Object [object Object],[object Object],...
source share