changing row color onRowRender

If I change the row color in the onRowRender event, it changes only when the row is taped/touched.

I set the color as follows:

local function onRowRender( event )            

            local row = event.row

            local idx = row.index or 0

            local color = 0

            

            if(listRecs[row.index].unlocked) then

                row._rowColor.default={255, 215, 0}

            end

end

If I change the row color in the onRowRender event, it changes only when the row is taped/touched.

I set the color as follows:

local function onRowRender( event )            

            local row = event.row

            local idx = row.index or 0

            local color = 0

            

            if(listRecs[row.index].unlocked) then

                row._rowColor.default={255, 215, 0}

            end

end

This should work:

[lua]

row._border:setFillColor( 255, 215, 0 )

[/lua]

Works like charm,  is there any advice on how to read the API Reference :smiley: thx

 

[quote=“fmatosic,post:3,topic:313478”]

Works like charm,  is there any advice on how to read the API Reference :smiley: thx

  [/quote]

Currently this is an unsupported way of doing it. We plan to make this easier moving forward.

Thanks

Guess I replied to fast, now when I tap/click on the row it removes the FillColor and sets the default

So i did this:

row._border:setFillColor( 255, 215, 0 )

row._rowColor.default={255, 215, 0}

I set both :slight_smile:

This dosent work ( removed ) in latest night build (CoronaSDK 2013.1106):

row._border:setFillColor( 255, 215, 0 )

it says: attempt to index field ‘_border’ (a nil value)

same here…

You can now do:

[lua]

local row = event.row

row:setRowColor( { default =  { 255, 255, 255}, over = { 255, 0, 0  } } )

[/lua]

or…

[lua]

row._cell:setFillColor( 255, 255, 255 )

[/lua]

If I change the row color in the onRowRender event, it changes only when the row is taped/touched.

I set the color as follows:

local function onRowRender( event )            

            local row = event.row

            local idx = row.index or 0

            local color = 0

            

            if(listRecs[row.index].unlocked) then

                row._rowColor.default={255, 215, 0}

            end

end

This should work:

[lua]

row._border:setFillColor( 255, 215, 0 )

[/lua]

Works like charm,  is there any advice on how to read the API Reference :smiley: thx

 

[quote=“fmatosic,post:11,topic:313478”]

Works like charm,  is there any advice on how to read the API Reference :smiley: thx

  [/quote]

Currently this is an unsupported way of doing it. We plan to make this easier moving forward.

Thanks

Guess I replied to fast, now when I tap/click on the row it removes the FillColor and sets the default

So i did this:

row._border:setFillColor( 255, 215, 0 )

row._rowColor.default={255, 215, 0}

I set both :slight_smile:

This dosent work ( removed ) in latest night build (CoronaSDK 2013.1106):

row._border:setFillColor( 255, 215, 0 )

it says: attempt to index field ‘_border’ (a nil value)

same here…

You can now do:

[lua]

local row = event.row

row:setRowColor( { default =  { 255, 255, 255}, over = { 255, 0, 0  } } )

[/lua]

or…

[lua]

row._cell:setFillColor( 255, 255, 255 )

[/lua]

Hey Danny, Not sure this is the proper place but I have a TableView and I want to change the color of the row when clicked, to show it is selected but when another row is clicked, I want to change the previously clicked row back to it’s original colors and change the newly clicked row to a new color.  I don’t find anything allowing me to do that.  Is their a way to control the actual colors of the row and not just the “tapped” color of the row?

Hey Danny, Not sure this is the proper place but I have a TableView and I want to change the color of the row when clicked, to show it is selected but when another row is clicked, I want to change the previously clicked row back to it’s original colors and change the newly clicked row to a new color.  I don’t find anything allowing me to do that.  Is their a way to control the actual colors of the row and not just the “tapped” color of the row?