Skip to content

Instantly share code, notes, and snippets.

@iantearle
Last active December 23, 2015 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iantearle/6630286 to your computer and use it in GitHub Desktop.
Save iantearle/6630286 to your computer and use it in GitHub Desktop.
This for some reason throws : "'undefined' is not a function (evaluating 'data.push(recommendRow.getView())')";
<Alloy>
<TableViewRow id="row" class="row" className="recommends">
<Label id="message">
</TableViewRow>
</Alloy>
var data = [];
query.find({
success: function(results) {
for(i = 0; i < results.length; i++) {
var data = {
itemId: results[i].attributes.itemId,
message: results[i].attributes.message,
user: results[i].attributes.user
};
var recommendRow = Alloy.createController('recommends.row');
recommendRow.setDetails(data);
data.push(recommendRow.getView());
}
$.recommends.setData(data);
},
error: function(error) {
alert("Error: " + error.code + " " + error.message);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment