Power table configure cell


i have two scripting , every one can work correct , but if i put them together, only the upside logic can work , can you teach me how to scripting make them working together

if selected:
	return {'background': self.selectionBackground}
elif rowView % 2 == 0:
	return {'background': 'white'}
else:
	return {'background': '#DDDDDD'}
	
	
	
config={}
if colIndex in [6]:
		lostTime = self.data.getValueAt(rowIndex,"OEE")
		var = 0.95
		if lostTime > var:
			config["background"] = "#FF0000"
			config["foreground"]="00FF00"
		else:
			config["background"] = "#00FF00"
			config["foreground"]="FF0000"
return config

Move the empty dictionary assignment ( config={} ) to the first line. Then make the three conditions at the top assign to config['background'] instead of returning. Your bottom section never runs because the return statements cut off execution of the function.

2 Likes

it works , thanks