Vision Power Table performance


I am facing performance issue with Power Table. My application imports XLS file, parse it and store inside Memory Tag (dataset type, about 35 rows and 20 columns). Power Table is placed inside template. Data property of Power Table is binded bidirectionaly to Custom property of template, which is then bidirectionaly binded to this Tag. Additionally, I am making some cells formatting inside configureCell extension function.

What are my observations:

  1. Scrolling through the table is very slow, not smooth.
  2. Scripting inside configureCell doesn’t affect this - I was trying to disable it.

What could be the reason? Maybe Memory Tag is not the best option and i should go with database?

Thank you in advance.
Best regards,

It’s not the dataset it’s the component itself/limitation of the web environment. Try turning on lazy loading with the ‘virtualised’ prop. This definitely speeds up initial loading and scroll speed, but it won’t preload every row anymore

Hello @nminchin . Thank you for the answer, but as I have mantioned in topic, issue is related to Vision Component called Power Table, not Perspective Table :slight_smile:

Ah whoops!

For slow scroll speed try this. Not sure if it’s your issue but still useful. Old script… There are things I would change now, but it works. Bonus function to scroll to a row as well


def fixScrollSpeed(scrollableObj):
 Set the scroll 'speed' from extremely slow (default) to useable
if event.propertyName in ['componentRunning']:
	components = scrollableObj.getComponents()
	# find the embedded JideScrollPane component
	for component in components:
		if str(type(component)) == "<type 'com.jidesoft.swing.JideScrollPane'>":
			scrollPane = component
	size = scrollPane.getSize()
	# set the scroll increment for the arrows to a fraction of the height of the scrollable panel
	scrollPane.getVerticalScrollBar().setUnitIncrement(size.height/4) #scroll amount for wheel and arrows
	# set the scroll increment when clicking on the scrollbar track piece to the height of the scrollable panel i.e. move 1 whole 'page' up/down
	scrollPane.getVerticalScrollBar().setBlockIncrement(size.height) #scroll amount clicking on scrollbar itself

def scrollTableToPos(tableObj, DataSetFieldName, NewDataSetPosValue):
	Scrolls the table component to the item 1 above the new position.
	templateRepeaterObj		- the table component
	DataSetFieldName		- the field name in the templateParams dataset to find the new position value in
	NewDataSetPosValue		- the field value of the field name to find in the dataset to move to
	No.		Date		Author			Comment
	1.0		2018-11		Nick Minchin	Original
	#get the template repeater dataset so that we can work out the current index of the maximum
	ds =
	ds = system.dataset.toPyDataSet(ds)
	if len(ds) > 0:
		#find the index of the new item from the template repeater dataset
		index = 0
		for i in range(len(ds)):
			if ds[i][DataSetFieldName] == NewDataSetPosValue:
				index = i
		#Get the full height of the template repeater if it were displayed without scrollbars. Using this we can calculate the relative position of the current step
		scrollBar = object.getComponents()[1]
		maxHeight = scrollBar.getMaximum()
		itemCount = len(ds)
		#Calculate the height of each item in the template repeater
		itemHeight = (1.0*maxHeight)/itemCount
		#Calculate the position of the current step using the item height and the new item's index
		newPos = int(itemHeight*(index-1))
		# move the scrollbar to the new item's position 

Thank you @nminchin, that’s awesome. Works a way better now !

1 Like