Keep the last row on a powertable selected until a boolean turns off

I want to select a row on a powertable and then select a button that will lock that row selection in place until a second button has been clicked. Is there a built in function with power tables that allows this or do I need to script it so that row is always selected?

Don’t think there’s any built in expressions to really do this. Sounds like scripting will be necessary. Clicking that first button should select the last row, turn on some lock/boolean custom property so that you can do a change script on the power table like

if event.propertyName == 'selectedRow' and firstButtonLockOn:
    event.source.selectedRow = event.oldValue

and then the second button would make firstButtonLockOff.

1 Like

This worked for me. Thank you for the help.

This code would still allow the user to select a new row for a split second before this event is executed. I dont know if this is an issue for what you’re doing with it, just something to keep in mind. You could also try disabling the component if you don’t want the user to be able to change rows at all

1 Like