How Can I select a record in table view

I created table view to display employees data which is read only.On Render Event I need to put all the logic to change background color once the user clicks on a particular record. Which is below

function onRender(event) {
if(event.isRecordSelected() && event.hasFocus())
{
        event.getRenderable().bgcolor='#3399FF'
}

Only one field which user has clicked gets background changed.
How can I accomplish when user clicks on particular field then entire row in table view of that particular field changes background color to blue…

what happens if you remove event.hasFocus() ?

if I remove event.hasFocus(), then by default it selects first available record/row in table view with bgColor change to blue

if(event.hasFouce)
{
           event.getRenderable().bgcolor='#3399FF'
}

bgColor for entire row should get change not to particular field where it get focus.

Is there any solution to this…