Table View Row Color On Touch

Hi

First of all this is my first project with Corona so sorry for any newbie error(NEWBIE BOARD! HURAYYY).

For my table view I wrote the below code:

[lua]

function onRowTouch( event )

if( event.phase == “ended”) then

for i = 1, hoursTable:getNumRows() do

hoursTable:getRowAtIndex( i ):setRowColor( {

default = {1, 0, 0},

over = { 0,1,0 }

})

end

 

event.target:setRowColor{

default = { 74/255, 74/255, 74/255, 1 },

over = { 74/255, 74/255, 74/255, 1 }

}

end

end

[/lua]

hoursTable --> TableView

(This is the question part)What I was trying to do is to desellect all previously sellected rows and sellect the one touched. What it does is it only sets the color of touched row to red( which is my desellect color for testing) and wont touch other rows. Any idea to fix this problem is welcome.

Have Fun… 

PS:Can be a resend  since I wasnt logged on on first sent and new to forums. If so sorry.

This thread might be of some help.

http://forums.coronalabs.com/topic/40774-tableview-highlight-row-selected/

Rob

This thread might be of some help.

http://forums.coronalabs.com/topic/40774-tableview-highlight-row-selected/

Rob