# How does Ignition Power Table load data on UI table?

**URL:** <https://forum.inductiveautomation.com/t/how-does-ignition-power-table-load-data-on-ui-table/53866>\
**Category:** Ignition\
**Created:** [December 8, 2021, 1:35am UTC](https://forum.inductiveautomation.com/t/how-does-ignition-power-table-load-data-on-ui-table/53866 "2021-12-08T01:35:29Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![gkchan](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gkchan](https://forum.inductiveautomation.com/u/gkchan)\
**Post date:** [December 8, 2021, 1:35am UTC](https://forum.inductiveautomation.com/t/how-does-ignition-power-table-load-data-on-ui-table/53866/1 "2021-12-08T01:35:29Z")

</div>

I am experiencing some lagginess (scrolling is not smooth) when scrolling the table on Ignition client panel while the dataset that the table is being binded to is being updated at the same time. Would like to understand what causes the scrolling to be laggy, whether its due to the way Ignition power table is loading data from dataset issue.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 8, 2021, 2:56am UTC](https://forum.inductiveautomation.com/t/how-does-ignition-power-table-load-data-on-ui-table/53866/2 "2021-12-08T02:56:28Z")

</div>

Are you using the configureCell extension method? Are you calling any external resources in that method?

---

<div class="post-metadata">

**Author:** ![gkchan](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gkchan](https://forum.inductiveautomation.com/u/gkchan)\
**Post date:** [December 8, 2021, 3:10am UTC](https://forum.inductiveautomation.com/t/how-does-ignition-power-table-load-data-on-ui-table/53866/3 "2021-12-08T03:10:33Z")

</div>

Yes, i am using configureCell extension method to map certain value.

What are external resources referred to?

Will the codes in configureCell extension method cause the scrolling to lag when an update to the dataset is ongoing?

Below is a snippet of the code under configureCell:

```auto
	if system.tag.readBlocking(['[System]Client/System/SystemFlags'])[0].value >= 3:
# strTooltipValue = self.data.getValueAt(rowIndex, 'REMARKS')

		# This example adds alternating background color:
		if selected:
			if colIndex == 4: 
				if value == "D":
					valueNew = "DI"
					valueText = value
				elif value == "L":
					valueNew = "LO"
					valueText = value
				return {'background': '#281C08','foreground': '#FF8232', 'text':valueText, 'toolTipText':valueNew}
				
			if colIndex == 2: 
				return {'background': '#281C08','foreground': '#FF8232', 'text':value, 'toolTipText':value}
			elif colIndex == 8:
				return {'background': '#281C08','foreground': '#FF8232', 'text':value, 'toolTipText':value}
			elif colIndex == 20:
				return {'background': '#281C08','foreground': '#FF8232', 'text':value, 'toolTipText':value}
			elif colIndex == 24:
				return {'background': '#281C08','foreground': '#FF8232', 'text':value, 'toolTipText':value}
			elif colIndex == 25: 
				return {'background': '#281C08','foreground': '#FF8232', 'text':value, 'toolTipText':value}
			else:
				return {'background': '#281C08','foreground': '#FF8232', 'text':value}
		else:
			if colIndex == 4:  
				if value == "D":
					valueNew = "DI"
					valueText = value  
				elif value == "L":
					valueNew = "LO"
					valueText = value
				return {'background': '#041D2B','foreground': '#6FCCFF', 'text':valueText, 'toolTipText':valueNew}
				
			if colIndex == 2: 
				return {'background': '#041D2B','foreground': '#6FCCFF', 'text':value, 'toolTipText':value}
			elif colIndex == 8:
				return {'background': '#041D2B','foreground': '#6FCCFF', 'text':value, 'toolTipText':value}
			elif colIndex == 20:
				return {'background': '#041D2B','foreground': '#6FCCFF', 'text':value, 'toolTipText':value}
			elif colIndex == 24:
				return {'background': '#041D2B','foreground': '#6FCCFF', 'text':value, 'toolTipText':value}
			elif colIndex == 25:
				return {'background': '#041D2B','foreground': '#6FCCFF', 'text':value, 'toolTipText':value}												
			else:
				return {'background': '#041D2B','foreground': '#6FCCFF', 'text':value}
				
		return {'horizontalAlignment':0}
		{'verticalAlignment':1}

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 8, 2021, 3:16am UTC](https://forum.inductiveautomation.com/t/how-does-ignition-power-table-load-data-on-ui-table/53866/4 "2021-12-08T03:16:15Z")

</div>

Don’t use any system.tag.\* or system.alarm.\* or system.db.\* functions (anything that makes a round trip to the gateway). Instead, bind the needed values to custom properties of the table, so you can reference them as `self.propName` in the configureCell script. That script gets called for every cell in the table, plus more when cells have to be re-drawn (like scrolling into view). That script must execute in a tiny fraction of a millisecond when there are thousands of cells.

---

<div class="post-metadata">

**Author:** ![gkchan](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gkchan](https://forum.inductiveautomation.com/u/gkchan)\
**Post date:** [December 8, 2021, 7:11am UTC](https://forum.inductiveautomation.com/t/how-does-ignition-power-table-load-data-on-ui-table/53866/5 "2021-12-08T07:11:05Z")

</div>

do u mean we should not be using this line of code here?  
if system.tag.readBlocking([’[System]Client/System/SystemFlags’])[0].value \>= 3:

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [December 8, 2021, 8:14am UTC](https://forum.inductiveautomation.com/t/how-does-ignition-power-table-load-data-on-ui-table/53866/6 "2021-12-08T08:14:06Z")

</div>

not in the configureCell yes.

if you create a custom prop and then reference that instead it should go smoother.

---

<div class="post-metadata">

**Author:** ![gkchan](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gkchan](https://forum.inductiveautomation.com/u/gkchan)\
**Post date:** [December 8, 2021, 10:44am UTC](https://forum.inductiveautomation.com/t/how-does-ignition-power-table-load-data-on-ui-table/53866/7 "2021-12-08T10:44:48Z")

</div>

The codes shall run in the custom property tag event script?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [December 8, 2021, 10:47am UTC](https://forum.inductiveautomation.com/t/how-does-ignition-power-table-load-data-on-ui-table/53866/8 "2021-12-08T10:47:42Z")

</div>

no  
you leave everything where it is expect

`system.tag.readBlocking(['[System]Client/System/SystemFlags'])[0].value`  
will turn into  
`self.yourVariableName`  
and create a custom variable yourVariableName  
with an expression binding to [System]Client/System/SystemFlags

This way you only read on the tag value there and not for every single cell

---

<div class="post-metadata">

**Author:** ![gkchan](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gkchan](https://forum.inductiveautomation.com/u/gkchan)\
**Post date:** [December 8, 2021, 11:15am UTC](https://forum.inductiveautomation.com/t/how-does-ignition-power-table-load-data-on-ui-table/53866/9 "2021-12-08T11:15:11Z")

</div>

why by creating a custom variable helps to ensure “This way you only read on the tag value there and not for every single cell” ?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [December 8, 2021, 11:42am UTC](https://forum.inductiveautomation.com/t/how-does-ignition-power-table-load-data-on-ui-table/53866/10 "2021-12-08T11:42:29Z")

</div>

system.tag.readBlocking() = “long” read gateway  
self.prop = “fast” read own props  
tagBinding = async “long” read every x amount of time to the gateway

if system.tag.readBlocking() in configureCell  
==\> number of cells \* “long” read ==\> lag

if self.prop in configureCell  
1 async “long” read every x amount of time to the gateway =\> no impact on scrolls/redrawn unless it changes  
=\> (number of cells \* “short” read ) ==\> no lag (hopefully)

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [December 8, 2021, 4:51pm UTC](https://forum.inductiveautomation.com/t/how-does-ignition-power-table-load-data-on-ui-table/53866/11 "2021-12-08T16:51:48Z")

</div>

This is pretty much the same as comparing this

```python
for i in range(100):
    x = long_operation()

```

and

```python
preprocessed_result = long_operation()
for i in range(100):
    x = preprocessed_result

```

In the first case, you run the long operation a hundred times,  
in the second case you run it only once and use the result a hundred times.
