Hi there,
i am using tableViewXL.lua 1.0 from Gilbert Guerrero.
i can easy get through the “listButtonRelease” function what ROW i selected.
But how would i get an information about the Item thats attached to the row?
I add Data like:
function add_data(id, userid, title,subtitle,image, more)
myData[id] = {}
myData[id].title = title
myData[id].subtitle = subtitle
myData[id].image = image
myData[id].id = id
myData[id].moreimg = more
myData[id].userid = userid
myData[id].category = “Dinner”
end
that comes assigned to the new TableView
myList = tableView.newList{
data=myData,
…
…
Now i tried to get for example my my data[id].userid in
function listButtonRelease( event )
self = event.target
local id = self.id
with self.userid
but it looks the event is just assigned to the rows itself and not the items bellow.
Any idea how to get my item.userid without creating a separate Table just to
assign row.id with a userid?
thx
chris
[import]uid: 4795 topic_id: 15094 reply_id: 315094[/import]
oh really, i don’t know why always i post a question and than 5 mins later i find the answer.
It may because writing the question does help my brain to puzzle the things together
ok simple, i just have to assign the row i got with the row.id from the tableview after release:
function listButtonRelease( event )
self = event.target
local id = self.id
print (myData[id].userid) – < just that
end
i keep it as usually for anyone who feels sometimes same stupid trapped like me
is there a way to extract the subtitle text…its easy to get the titleText.text but i cant seem to find the equivalent for the subtitle text?? if this is a dumb question i apologize in advance … [import]uid: 85717 topic_id: 15094 reply_id: 56849[/import]
function listButtonRelease( event )
than its same like above
function listButtonRelease( event )
self = event.target
local id = self.id
print (myData[id].subtitle) – < just that
end
chris
[import]uid: 4795 topic_id: 15094 reply_id: 56863[/import]
Chris, thank for the response , however im using
function listButtonRelease( event )
self = event.target
local id = self.id
print (myData[id].subtitle) – < = table: 0x281ccd0
end
and all it produces is a table reference of some kind when i would like to have the text from the subtitle of the cell
i can get the title back as text using event.target.titleText.text
but there does not seem to be a way for me to get the subtitle text back…Im on a Mac maybe that makes a difference
UPDATE:
print(myData[id].subtitle.label) this works!! thanks for pointing me in the right direction altho technically speaking im accessing the data from my own array and not directly from the table itsself…
UPDATE:
print(myData[id].subtitle.label) this works!! thanks for pointing me in the right direction altho technically speaking im accessing the data from my own array and not directly from the table itsself… [import]uid: 85717 topic_id: 15094 reply_id: 56937[/import]