Its a few steps.
First you need to start using the new row params when inserting into table, introduced few daily builds back.
[lua]
scene.tableView:insertRow {
etc = ect
params = {score = 123, gameID = 234},
}
[/lua]
When you are rendering your row you need to use the params.
[lua]
function onRowRender( event )
local row = event.row
local score = row.params.score
local gameID = row.params.gameID
local score = display.newText(row, score, 10, 10, native.systemFont, 10)
– Make a reference to the score object in the row group so we can access it later
row.scoreObject = score
end
[/lua]
When the score changes you need to iterate through your tableView and change the params:
[lua]
function updateScore(newScore, gameID)
local tableViewRows = tableView._view._rows
for k, row in ipairs(tableViewRows) do
local rowGameID = row.params.gameID
local rowScore = row.params.score
if rowGameID == gameID then
rowScore = newScore
– Now when row is rerendered, that is if you scroll a row off screen and on screen again the score will be updated because the params it uses to render the score is updated. However already rendered (visible rows) will not change. So you need to add that .
if row._view then – Update row if its currently rendered
row._view.scoreObject.text = newScore
end
end
end
end
[/lua]