Titanium JS: Error using Alloy data binding: 'undefined' is not an object (evaluating '__alloyId60.on') -


I have created a new controller ( search.js ) in titanium alloy, within which I I have referenced one of my collections:

search.js

  var searchResults = Alloy Collections.searchResults;   

and then in my view ( search.xml ) I have created a tableview, and added the data collection feature:

< Strong> search.xml

  & gt; Table View ID = "ResultsTable" Datacallication = "Search Results" & gt; & Lt; Tableview title = "{name}" /> & Lt; / Tableview & gt;   

In my controller, this archive is populated with data through an online API, when a user performs a search in this code, results all A JSON object with the data is:

search.js

  _ Each (results, functions) {var bier = alloy.createModel ('searchResults', item); searchResults.push (beer);});   

When I run my app, I get the following error message:

"'undefined' is not an object (evaluation '__alloyId60.on ') "

I do not know where I'm going, am I missing something?

I define the global frequency of my collection in my alloy.js file Has fixed this error by:

  Alloy.Collections.searchResults = Alloy .createCollection ('searchresults');   

I found it from on the Appcelerator Developer Forum.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -