The problem could be that in your "select all" handler (SelecetAllEventListener
) you are setting a flag to 1 then reloading the scene. This will cause, IIUC, the onRowRender to be called again, but it won't cause the onRowTouch to be called again (since there hasn't been a touch of a row). What you need to do is that in SelecetAllEventListener
you loop over all your rows and change the visibility of the checkmark. Your code doesnt' show where you keep your rows but I will assume in a variable:
local tableRows = {}
local toggle = true
local function somewhereInYourCode()
...
newRow = ...
yourTable:inserRow(newRow) -- will cause onRowRender to get called
table.insert(tableRows, newRow)
...
end
local function SelecetAllEventListener( event )
for i,row in ipairs(tableRows) do
row[6].isVisible = toggle
end
toggle = not toggle -- for next time
return true
end
Your code doesn't show where you insert rows so I put it in somewhereInYourCode()
but you get the idea.