Delay in Updating Embedded View Buttons in Table Rows

Hi,

We have a table where the first column contains an embedded view showing different buttons.
Each button has its own conditions for whether it should be displayed or hidden.
To handle this, we’ve bound the display property of each button to rowData and check the conditions accordingly.

The problem is that when the table’s data changes, the button updates happen with a noticeable delay — for example, one button disappears, and then about a second later, the next one appears.

We’d like these changes to update instantly and all at once, without the intermediate delay.
Is there a recommended way to achieve this in Perspective?

in first the image we click Play button 3rd from left.

image

The second image seen like this.

image

Then with delay it show the final.

image

Thanks.

What do those bindings look like? Pure Expression bindings will execute much quicker than script transforms.

First thanks.

The display binding as below:

Expression:  if(indexOf({session.props.auth.user.roles}, "Administrator") >= 0, {view.params.rowData}, None)
def transform(self, value, quality, timestamp):
	
	v_processed=getattr(value,"PROCESSED","")		
	v_processed2= getattr(v_processed,"value","")	
	v_inpause=getattr(value,"INPAUSE","")
	v_inpause2= getattr(v_inpause,"value","")
		
	if (v_processed2==2) and (not (v_inpause2)):
		return True
	else:
		return False
		

I think that can be simplified into just an Expression:

if(indexOf({session.props.auth.user.roles}, "Administrator") >= 0, 
	{view.params.rowData.PROCESSED.value} = 2 && !{view.params.rowData.INPAUSE.value}, 
	null
)

(I’m not sure if None works in Expressions, but I always use null.)

3 Likes

Thank you, Ryan. I implemented your suggestion, and it’s working flawlessly now.

1 Like