I have a tableview that works correctly when a row is touched. I have now added a button to each row with a touch listener so the event that is triggered is not the onRowTouch event rather the event listener for the button itself. How can I capture which row the button was on when it was pressed? I have tried every combination of event.xxx that I could think of and they all return nil. I know that I am overlooking something simple. Sample code below. Using widget 2.0, Build 1137.
Thanks ahead of time! Scott
local function infoBtnRelease( event ) -- what code goes here that will give me the row end local function onRowRender( event ) local row = event.row local rowGroup = event.view local idx = event.row.index local name = display.newText( row, "Hello world", 0, 0, native.systemFontBold, 14 ) name:setReferencePoint(display.TopLeftReferencePoint) name.x = 58 name.y = 7 local infoBtn = display.newImage( row, "infoBtn.png", 0, 0) infoBtn:setReferencePoint(display.TopRightReferencePoint) infoBtn.x = 315 infoBtn.y = 12 infoBtn:addEventListener("touch", infoBtnRelease) end local function onRowTouch( event ) local phase = event.phase if phase == "release" then -- Do some things when row is touched -- this works correctly end end