Hi,
I have a tableView setup and I need to use data from mc:getMe( function(e) result list. I am trying to store the results into a table then use that table as my data for the tableView. For some reason it is not working. Here is my code:
mc:loginUser(userEmailCheck, userPasswordCheck, function( event1 )
mc:getMe( function(e)
orders = e.result.orders
for i = 1, #orders do
myList:insertRow{
rowHeight = 60,
isCategory = false,
rowColor = { 1, 1, 1 },
lineColor = { 0.90, 0.90, 0.90 },
params = {
drinkName = orders[i].drinkName,
cost = orders[i].cost
}
}
end
Here is what’s printing in my console:
result:
Jun 15 10:22:50.273 name: David S
Jun 15 10:22:50.273 objectId: b3e24e99b1
Jun 15 10:22:50.273 orders:
Jun 15 10:22:50.273 0:
Jun 15 10:22:50.273 date:
Jun 15 10:22:50.273 drinkName: Clark Kent
Jun 15 10:22:50.273 cost: Superman
Jun 15 10:22:50.273 1:
Jun 15 10:22:50.273 date:
Jun 15 10:22:50.273 drinkName: Clark Kent
Jun 15 10:22:50.273 cost: Superman
Jun 15 10:22:50.273 2:
Jun 15 10:22:50.273 date:
Jun 15 10:22:50.273 drinkName: Clark Kent
Jun 15 10:22:50.273 cost: Superman
My mongo user’s record looks like this:
orders: [
{
drinkName: “Clark Kent”,
cost: “50”,
date: “”
},
{
drinkName: “Clark Kent”,
cost: “50”,
date: “”
},
{
drinkName: “Clark Kent”,
cost: “50”,
date: “”
}
]
Can someone please help! This is driving me nuts
Thanks!