I have a “x minutes ago” counter in a tableView and needed to get it updating onscreen, but without reRender working, it never updates (unless I scroll it offscreen and back on of course).
To get it working without reRender I had to do a little tom foolery (half a dozen lines or so, but tom foolery nonetheless). Oh, and kudos for ksan for helping me figure out how to get it done
First, save off the pointer to the text to later be changed in the row (in onRowRender)
[lua]
local timestampText = getTS(currMess) – get correct timestamp return it as a corona text object
currentMessages[row.index].TS = timestampText – Let’s see if we can remove / replace this later… muhahaha
[/lua]
Later, to change it: (in a screenUpdate routine that checks every 30 seconds during an enterFrame event)
[lua]
– this.messageList is my tableView structure, newTS is my new timestamp text in a row
this.messageList._view._rows[i]._view:remove(currentMessages[i].TS) – remove old text
local newTS = getTS(currentMessages[i]) – get new updated text object
this.messageList._view._rows[i]._view:insert(newTS) – insert into row
currentMessages[i].TS = newTS – resave pointer for next update
[/lua]
That’s about it. Undocumented, but it works like a champ.
No reRender. No scrollToY, no nothing else.
Edit: ahh shoot, the #@$%@#$$ formatting is messed up, ARGGGGGHHHHH!!!