Vision Power Table call configureHeaderStyle dynamically

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:

You can make that a lot more efficient by caching the custom editor as a local (Swing, not Ignition) client property (see this thread: Designer Color Chooser vs Runtime Color Chooser - #4 by PGriffith for more info on that), and simply setting it as the editor for all the appropriate columns on data change.

1 Like