List Comp: cellAttribs.bgColor

I want to highlight with different colors whole row and cell on rollover

How to remove cellAttribs.bgColor from previously highlighted cell?

Hey,

I would suggest having a look at the simpleList component in the Palette>UI section.

There in the onRollover section of the List COMP callbacks you can see how you can use the row and prevrow attribute to change the current cells and previous cells color.

def onRollover(comp, row, col, coords, prevrow, prevcol, prevcoords):
	if row != prevrow:
		if row > 0:
			rowAttribs = comp.rowAttribs[row]
			rowAttribs.bgColor = parent().pars('Rowrollcolor*')
		
		if prevrow > 0:
			rowAttribs = comp.rowAttribs[prevrow]
			rowAttribs.bgColor = parent().pars('Rowcolor*')
			
	return

Let me know if you need more info on this.
Cheers
Markus

[code]def onRollover(comp, row, col, coords, prevRow, prevCol, prevCoords):

if row > 0:		
	cellAttribs = comp.cellAttribs[row, 3 ]
	cellAttribs.bgColor = [ 0.2, 0.2, 0.2, 1 ] 
	
	if col == 3:
		cellAttribs = comp.cellAttribs[row,col]
		cellAttribs.bgColor = [ 0.25, 0.25, 0.25, 1 ] 

if row != prevRow:		
	if row > 0:
		rowAttribs = comp.rowAttribs[row]
		rowAttribs.bgColor = [ 0.2, 0.2, 0.2, 1 ] 	
		
	if prevRow > 0:
		rowAttribs = comp.rowAttribs[prevRow]
		rowAttribs.bgColor = [0.16, 0.16, 0.16, 1]				

		cellAttribs = comp.cellAttribs[prevRow,3]
		cellAttribs.bgColor = [0.16, 0.16, 0.16, 1]							

return[/code]

Looks like its working this way. Thanks!