Hi there.
I´m working with power table and I need to color a complete row once an "if" condition be met as follows;
(colIndex = 10 and value > 1100) and (colIndex = 7 and value = 'valve NOK')
How can I do this?
Hi there.
I´m working with power table and I need to color a complete row once an "if" condition be met as follows;
(colIndex = 10 and value > 1100) and (colIndex = 7 and value = 'valve NOK')
How can I do this?
You will need to transform your data to include styling information in the values for each row that you want to highlight. See the Perspective table's sample data for how to shape your data.
In the designer, right click on the power table and select scripting in the popup. From there, enable the configureCell extension function.
I don't usually used indexes for this sort of thing, even though the power table does differentiate between the view index and the initial dataset index. I prefer to use column names because if the query is changed at some point in the future, I feel like there is less of a chance that my script will break. Here is an example of how to do this in your use case:
#def configureCell(self, [...]):
# Get the data from the dataset for the corresponding columns on the row of the cell being evaluated
if self.data.getValueAt(rowIndex, 10) > 1100 and self.data.getValueAt(rowIndex, 7) == 'valve NOK':
# Set the background to yellow
return {'background': 'yellow'}
To use a column name instead of the index, the getValueAt
call would look like this: self.getValueAt(rowIndex, 'Information') > 1100