TableView alternate colour rows not working after a deleteRow - help!

Hi all, 

I’ve got a fairly bog-standard tableview which uses alternate cell colours to improve the look and feel, problem is, if I delete one of the rows (say, a white one between two blues, I can’t seem to get the table to reRender the background colours properly, instead of white, blue, white, blue etc I get white, blue, blue etc…

Reading the docs, onRowRender only seems to fire if an insert action is applied, so what’s the best way to delete the required item and then re draw the visible rows with the correct cell colours? 

Given the current tableView functionality, I can’t think of a way other than empty the whole table and reRender again. Sorry.

Actually you could try tableView:reloadData() if it doesn’t reload (check if it does or not) you need to remove the rows view first. You can access the rows view via tableView_view._rows[index]._view So do a display remove and set it to nil. then reloadData wil work if it didn’t already without this.

You will have a problem though with indexes as they don’t change when you delete a row, so you will have an empty index in the rows table and indexes reported in onRowRender are not continuous. You would have to figure out a way around that to get the correct color order again.

Given the current tableView functionality, I can’t think of a way other than empty the whole table and reRender again. Sorry.

Actually you could try tableView:reloadData() if it doesn’t reload (check if it does or not) you need to remove the rows view first. You can access the rows view via tableView_view._rows[index]._view So do a display remove and set it to nil. then reloadData wil work if it didn’t already without this.

You will have a problem though with indexes as they don’t change when you delete a row, so you will have an empty index in the rows table and indexes reported in onRowRender are not continuous. You would have to figure out a way around that to get the correct color order again.