Hi
I’m filling up the content of a tableView from SQLite using a simple query:
for row in db:nrows("SELECT \* FROM main WHERE difficulty=" .. param .. " ORDER BY status, topHeight DESC") do
Then I put these values inside a function, to calculate the values
local function onRowRender( event ) local phase = event.phase local row = event.row local function subs(time, height, status, routeh) local t if ( dbRec[row.index].status == 1 ) then t = "top time: "..timeConversion(time) else t = "climbed: "..percentage( height, status, routeh ).."%" end return t end
and enter them inside a table row
local value = {} value[row.index] = subs(dbRec[idx].timeBest, dbRec[idx].topHeight, dbRec[idx].status, dbRec[idx].routeH ) local subTitle2 = display.newText( row, value[row.index], 0, 0, nil, 18 ) subTitle2:setReferencePoint( display.CenterRightReferencePoint ) subTitle2.x = row.contentWidth - 20 subTitle2.y = row.contentHeight - 24 subTitle2:setTextColor( 90, 90, 90 )
All this works just great for all the table rows, which are on screen. But as soon as I scroll down, these values are overriden by some other.
Can someone please help?