Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.