Last active
December 23, 2015 11:39
-
-
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())')";
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Alloy> | |
<TableViewRow id="row" class="row" className="recommends"> | |
<Label id="message"> | |
</TableViewRow> | |
</Alloy> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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