Vision Power Table component
ConfigureHeader extension function.
Is there a way to dynamically call the configureHeaderStyle extension function? I need to update the header style as new data is selected for the table component.
I’ve got a power table that I am using to show a dataset containing digital IO card data for maintenance troubleshooting on a machine. The table has a custom property called cardBackgroundColor that is bound to an integer member of the card data UDT. I use this integer to control the background color of the header on our HMI faceplates, based on the type of card (input/output/safety etc) and I would like to replicate this same function on our Ignition clients.
I have the logic working properly in the configureHeaderStyle function, but if I change the selected dataset using a tabstrip on the window, then the header returns to its default style.
Here is what the header looks like when I open the page on an input card:
Then if I select a new card (new tab):
Is there a way to force the table to run the function? I’ve tried calling
But this just returns an AttributeError:
AttributeError: 'com.inductiveautomation.factorypmi.application.com' object has no attribute 'configureHeaderStyle'
You can’t do this directly using the configureHeaderStyle(). Unfortunately, to make it fully dynamic you’ll have to suddenly jump a few layers down in Java Swing.
What you can do from configureHeaderStyle is limited - but there are still other options. What you’ll have to do is create your own header renderer and set it to be used for the columns of your dataset - likely, each time your dataset changes. There’s an example of this technique here: