In my eyes, there is no need to a separate reRender Listener. Just a tableView:reRender() function which reRender all visible rows. You can include all potential cases in the standard onRowRender function.
Lets say, you want to show a delete button in each row, if the user hits a button at the toolbar:
function onRowRender() -- generate standard row items here if editButtonFlag == true then -- generate deletebutton here end end function editButtonListener(event) editButtonFlag == true myTableView:reRender() end
thats it. My actual approach is to delete and recreate all rows, what probably is not the most efficient way. I have a tableView which updates on the fly by user input in a textfield, so it should be as fast as possible. Thats my actual solution:
-- eventListener on table (list) updates function MyClass:atUpdate(event) local tableview = self.tableView local list = self.list if #list == 0 then self:hideTableView() else tableview:deleteAllRows() for i=1,#list,1 do tableview:insertRow{ rowHeight=64, isCategory=false, } end self:showTableView() end end
Hope that helps, and thanks for asking for our needs.