How to Capture the Row of a Display Object that is Located within a Tableview

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

Where you create your button, create a custom property. 

[lua]

local infoBtn = display.newImage( row, “infoBtn.png”, 0, 0)

infoBtn.idx = idx

[/lua]

In your button function get the idx with:

[lua]

local function infoBtnRelease( event )
    – what code goes here that will give me the row

     local idx = event.target.idx
end

[/lua]

Works perfectly and is simple as I thought it should be! Thanks Jon!

Where you create your button, create a custom property. 

[lua]

local infoBtn = display.newImage( row, “infoBtn.png”, 0, 0)

infoBtn.idx = idx

[/lua]

In your button function get the idx with:

[lua]

local function infoBtnRelease( event )
    – what code goes here that will give me the row

     local idx = event.target.idx
end

[/lua]

Works perfectly and is simple as I thought it should be! Thanks Jon!