[bug-13773]Ignition 8 - Alternating Row Background not working properly for Power Table

I haven’t seen this posted anywhere, but it seems like odd row background coloring on the Power Table component is broken for columns of type Boolean.

I have added two components with test data, one is a Power Table with configureCell enabled, and the other is a Table component with Background Mode set to Alternating.

You will see that both background and selection appear to be broken for Power Table, but not so for Table.

Bonus question: How do I report bugs?

To support. As in, either support.inductiveautomation.com or support@inductiveautomation.com.

Hi,

Did you get an answer regarding this question?

A bug was logged back in September, but it has yet to be fixed. A couple of weeks ago I downloaded 8.0.7 and the bug has not been squashed.

Hopefully they can get to it soon.

Put the following on the initialize extension function.

from java.lang import Boolean
	
table = self.getTable()
table.getDefaultRenderer(Boolean).setOpaque(True)

Thanks, @jpark!

While that solved the issue on my proof of concept, it will be a bit more challenging updating each Power Table component on every project that I have. But I guess it would take me less time than waiting on IA to fix the bug.

For what it’s worth, I just kicked the bug ticket to a slightly higher priority - should help getting it fixed sooner.

2 Likes

Thanks all of you!

Hi,

I have a different problem but with the same bug… I got 2 columns with the data type ‘date’ one of which contains the current time stamp of when the note was created then the other is when the note is modified or if it is modified… When the column Date Modified have no date (SQL table = NULL) my row have not the back ground I have expected … they stay white because I have no value(NULL)… I joint you a screenshot of my bug. My version of Ignition is the new one 8.0.12

Best regards, Gabriel

Post your configureCell code.

Never mind Its work now its because I used translation (the problem was with the function Translate = system.util.translate(textValue) on my code and now with this code is good:

#this section is for set the Width of the column in % of 100% of the size Table
tab = self  # Table is self
w = tab.width  # The Size in pixel of the table
	
	            
tab.setColumnWidth(0,w*4/100)  # Calcul for 4% of the table for the Coloumn 0
tab.setColumnWidth(1,w*5/100)  # Calcul for 5% of the table for the Coloumn 0
tab.setColumnWidth(2,w*8/100)  # Calcul for 8% of the table for the Coloumn 0
tab.setColumnWidth(3,w*4/100) # Calcul for 4% of the table for the Coloumn 0
tab.setColumnWidth(4,w*44/100) # Calcul for 44% of the table for the Coloumn 0
tab.setColumnWidth(5,w*9/100)  # Calcul for 9% of the table for the Coloumn 0
tab.setColumnWidth(6,w*8/100)  # Calcul for 8% of the table for the Coloumn 0
tab.setColumnWidth(7,w*9/100)  # Calcul for 9% of the table for the Coloumn 0
tab.setColumnWidth(8,w*8/100)  # Calcul for 8% of the table for the Coloumn 0
	# Total = 100%
	
	
if selected :
	if not textValue == "" and (not colIndex == 8) :
		Translate = system.util.translate(textValue)
		return {'background': self.selectionBackground, 'text' : Translate}
	else:
		return {'background': self.selectionBackground}
	       
	               
elif rowView % 2 == 0 :
	if not textValue == "" and (not colIndex == 8):
		Translate = system.util.translate(textValue)
		return {'background': 'white', 'text' : Translate}
	else:
		return {'background': 'white'}
	   
	           
else:
	if not textValue == "" and (not colIndex == 8):
		Translate = system.util.translate(textValue)
		return {'background': '#DDDDDD', 'text' : Translate}
	else:
		return {'background': '#DDDDDD'}

But I don’t now WHY Translate = system.util.translate(textValue) break my column

Hello, @gpellicelli.

To answer your question, system.util.translate breaks when attempting to translate None.

A way you could check in Python if a string is not null or empty would be by doing the following:

# Instead of:
if not textValue == "" and (not colIndex == 8):
    # Do stuff...

# Try this:
if textValue and colIndex != 8:
    # Do stuff...

I tested that substitution and it worked on my end.

Cheers!

Ho thanks you I will try this tomorrow :smiley:

The primary issue reported here, with boolean columns, is fixed for 8.0.14.

Can’t wait!

Thanks!

If I click on a boolean column the selectedRow property doesn't change. Is this fixed in 8.0.14 also? when will 8.0.14 be released?