How to get tableView row data when touched with index?

Hello,

I was reading the documentation for the tableView and in the example they show how to handle when a row is touched and it returns the event.target.index which I assume is the row number. How can I get the data from the row? Below is the code from the documentation.

I have another question on this. In another post the user Icy Spark gave me this code for adding columns to the rows. How can I get the data for each column when a row is clicked? I added this code for adding the columns below also. I want to show data in multiple columns for each row. then allow the user to click on a row and do something with it.

Thanks! Warren

-- Handle touches on the row  
local function onRowTouch( event )  
 local phase = event.phase  
  
 if "press" == phase then  
 print( "Touched row:", event.target.index )  
 end  
end  
local function onRowRender( event )  
local row = event.row  
local rowGroup = event.view  
local halfh = row.height \*0.5  
--add first column  
row.col1 = display.newText( "Column1: ",50,halfh, native.systemFont, 12 )  
row.col1:setReferencePoint( display.CenterLeftReferencePoint )  
row.col1.x= 50  
row.col1.y = halfh  
row.col1:setTextColor( 0 )  
--add second column  
row.col2 = display.newText( "Column2: ",150,halfh, native.systemFont, 12 )  
row.col2:setReferencePoint( display.CenterLeftReferencePoint )  
row.col2.x= 150  
row.col2.y = halfh  
row.col2:setTextColor( 0 )  
--add col1 and col2 to the row group  
rowGroup:insert( row.col1 )  
rowGroup:insert( row.col2 )  
end  

[import]uid: 184193 topic_id: 37372 reply_id: 67372[/import]

Would I save the data in an array and then access it based on the row index selected? Or get the data straight from the dataView?
[import]uid: 184193 topic_id: 37372 reply_id: 145677[/import]

I usually have a table of data that I use to build the tableView, then when I touch a row, I access the original table of data. [import]uid: 199310 topic_id: 37372 reply_id: 145708[/import]

Would I save the data in an array and then access it based on the row index selected? Or get the data straight from the dataView?
[import]uid: 184193 topic_id: 37372 reply_id: 145677[/import]

I usually have a table of data that I use to build the tableView, then when I touch a row, I access the original table of data. [import]uid: 199310 topic_id: 37372 reply_id: 145708[/import]