Disable/enable row selection in table

Hello, I've got a button with this action:

def runAction(self, event):
    self.view.custom.enable_selection = False
    import time
    time.sleep(0.1)
    self.view.custom.enable_selection = True

With the sleep, it works. But without it, enableRowSelection doesn't change to false then true, it just stays in true.

Not entirely sure what you are looking to accomplish here, but you are most likely just not “seeing” then change without the sleep.

That would be pretty much instantaneous without the sleep.

To test you can just do it like this and then watch the console as you click it.

self.view.custom.enable_selection = False
system.perspective.print(‘Disabled’) 
self.view.custom.enable_selection = True
system.perspective.print(‘Enabled’)