How to update tableView non-focus Row appearance (widget 2.0)

So here is my problem.  I want to allow a user to highlight a row in the TableView when touched and have any other row that was previously highlighted go back to “normal”.

Given that the currently selected row may or may not be on screen things get a bit difficult.  

I can keep a pointer to the currently selected data item

There seems to be no API call to ask:  row.isRendered()

So i have to do something like:

if (currentSelectedItem.parent ~= nil)

Which is a bit lame

The other thing that comes up with trying to update display items in a tableView dynamically is it would be nice to have a way to forceRerender a row … so i can change the font, etc on the selected row and revert the font, etc on the row losing focus if it is on screen.

maybe something like tableView:forceRenderRowIfOnScreen(index)

Just struggling a bit and certainly not wanting to be looking at variables inside of your tableView as those may change without notice.

Anyone facing this kind of issue?

Seems a couple of tableView functions would be helpful here to keep us from having to hack our way around using Tableview.

Then again … perhaps i missed this thread already or simply don’t get something about the API that is obvious.

Cheers,

m

So here is my problem.  I want to allow a user to highlight a row in the TableView when touched and have any other row that was previously highlighted go back to “normal”.

Given that the currently selected row may or may not be on screen things get a bit difficult.  

I can keep a pointer to the currently selected data item

There seems to be no API call to ask:  row.isRendered()

So i have to do something like:

if (currentSelectedItem.parent ~= nil)

Which is a bit lame

The other thing that comes up with trying to update display items in a tableView dynamically is it would be nice to have a way to forceRerender a row … so i can change the font, etc on the selected row and revert the font, etc on the row losing focus if it is on screen.

maybe something like tableView:forceRenderRowIfOnScreen(index)

Just struggling a bit and certainly not wanting to be looking at variables inside of your tableView as those may change without notice.

Anyone facing this kind of issue?

Seems a couple of tableView functions would be helpful here to keep us from having to hack our way around using Tableview.

Then again … perhaps i missed this thread already or simply don’t get something about the API that is obvious.

Cheers,

m

I fully agree.

I have some new row methods which should help in this specific case and am planning on adding a method for you to force re-rendering of a row (or all rows) as soon as time allows.

Thanks

So here is my problem.  I want to allow a user to highlight a row in the TableView when touched and have any other row that was previously highlighted go back to “normal”.

Given that the currently selected row may or may not be on screen things get a bit difficult.  

I can keep a pointer to the currently selected data item

There seems to be no API call to ask:  row.isRendered()

So i have to do something like:

if (currentSelectedItem.parent ~= nil)

Which is a bit lame

The other thing that comes up with trying to update display items in a tableView dynamically is it would be nice to have a way to forceRerender a row … so i can change the font, etc on the selected row and revert the font, etc on the row losing focus if it is on screen.

maybe something like tableView:forceRenderRowIfOnScreen(index)

Just struggling a bit and certainly not wanting to be looking at variables inside of your tableView as those may change without notice.

Anyone facing this kind of issue?

Seems a couple of tableView functions would be helpful here to keep us from having to hack our way around using Tableview.

Then again … perhaps i missed this thread already or simply don’t get something about the API that is obvious.

Cheers,

m

I fully agree.

I have some new row methods which should help in this specific case and am planning on adding a method for you to force re-rendering of a row (or all rows) as soon as time allows.

Thanks