I created a tableView list.
After list complete creation, I want to access each row in this list ,and to update all its “row.name” values.
How can I do it?
The code:
local function onRowRender( event )
local group = event.view
local row = event.target
local image2 = display.newImage (“assets/images/rate.png”)
group:insert(image2)
I’m not sure you can access the row.name from outside the onRender/onEvent functions. But why not create a table and use that instead of event.target? That way you can access the row-content from anywhere [import]uid: 14018 topic_id: 29457 reply_id: 118280[/import]
@Mitaten actually , when user presses on some row, I need to update “isVisible” property of image2 in each row to the new value (“true”/“false”). So I have to access the image2 object of each row in some way.
Do you mean to save in the extern table the memory addresses of all image2 objects with its creations? It really could be a good idea if I understood you correctly. [import]uid: 144261 topic_id: 29457 reply_id: 118282[/import]
Create a table outside of the onRender function, then simply replace row.name with table[id], where id being a number you add +1 to for every row you create
that way, if you want to access for example the row.name in your third row in the list, you simply do table[3].isVisible = false
And if you want to update the isVisible of all rows you can simply iterate through the table and flip on/off the isVisible property
Hope I’m making sense, brain cells aren’t top shape right now :-p [import]uid: 14018 topic_id: 29457 reply_id: 118286[/import]