Looking for help with configureCell extension

Hello all,

I'm looking for help, or maybe more specifically an alternate way of accomplishing highlighting a row in a power table.

I want to highlight a specific row, based on a step number which lives in the PLC.

I do not want the user to be able to select a row so row selection is turned off.

I am currently using configureCell extension to look at a custom property which I have bound to the PLC tag. When I load into the page with my power table, the appropriate row highlights as expected. The issue issue is that it doesn't dynamically update as the underlying dataset isn't changing.

The dataset itself is loaded from the PLC as well when the page initializes.

I've messed with trying to refresh the dataset but besides being unsuccessful it seems unnecessary and inefficient as the data in the dataset hasn't changed in any way.

I was thinking the propertyChange event handler maybe but then I wouldn't have access to the "background" attribute so then maybe a custom method - but that's a little out of my wheelhouse from a programming standpoint.

Anyone have any thoughts on the best way to accomplish this?

Thanks in advance

Where did you put the custom property for the tag binding? If on the table itself, changes should trigger redraw, I thought, which is the underlying mechanism that causes calls to .configureCell().

If I'm wrong, then use a propertyChange event to monitor the binding, and call the native .repaint() method. (Give it the whole table's bounds.)

OMG Phil I'm an idiot. I'm not in front of the system right now but I bet I put the custom property on the root and not on the table itself. As soon as I can get back there I will verify and post. Thank you!

Hey Phil,

So I did have the custom property on the root container and not on the power table, but moving it to the power table did not work either.

I did not know about the .repaint() method, but after a couple of tests I was able to get that to work and behave as expected.

In case it can help someone else:

So on the power table's PropertyChange event handler I have:

if event.propertyName = 'CurrentStep':
     table = event.source.parent.getComponent('Power Table')
     table.repaint()

Thanks Phil for getting me pointed in the right direction!

1 Like

To preserve code indentation (essential for Python) you need to format the code using the </> button. There's an edit link below your post.