# Power Table Cell Color

**URL:** <https://forum.inductiveautomation.com/t/power-table-cell-color/33082>\
**Category:** Ignition Early Access\
**Created:** [March 13, 2020, 8:23pm UTC](https://forum.inductiveautomation.com/t/power-table-cell-color/33082 "2020-03-13T20:23:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon55648468](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@anon55648468](https://forum.inductiveautomation.com/u/anon55648468)\
**Post date:** [March 13, 2020, 8:23pm UTC](https://forum.inductiveautomation.com/t/power-table-cell-color/33082/1 "2020-03-13T20:23:14Z")

</div>

Hi guys, is there a way to trigger a change of cell color on cell edit? I know configure cell can provide the function, but i am a little uncertain if i can use it just at the moment of value change

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [March 14, 2020, 12:31pm UTC](https://forum.inductiveautomation.com/t/power-table-cell-color/33082/2 "2020-03-14T12:31:08Z")

</div>

EDIT: Sorry, posted before I was really finished.

Not quite an out of the box function.  
I used a custom property on the table called ‘edited’. It’s the same size as data, but is filled with zeroes.

onCellEdited:

```python
	self.data = system.dataset.setValue(self.data, rowIndex, colIndex, newValue)
	if oldValue != newValue:
		self.edited = system.dataset.setValue(self.edited, rowIndex, colIndex, 1)

```

configureCell:

```python
	if selected:
		if self.edited.getValueAt(rowIndex, colIndex) == 1:		
			return {'background': 'yellow', 'foreground': 'black'}
		else:
			return {'background': self.selectionBackground, 'foreground': self.selectionForeground}
	elif self.edited.getValueAt(rowIndex, colIndex) == 1:
		return {'background': 'yellow'}

	else:
		return {'background': 'white', 'foreground': 'black'}

```

A reset button to, well, reset it.

```python
data = event.source.parent.getComponent('Power Table').data

headers = list(data.getColumnNames())

dataOut = [[0]*data.getColumnCount()]*data.getRowCount()

event.source.parent.getComponent('Power Table').edited = system.dataset.toDataSet(headers, dataOut)

event.source.parent.getComponent('Power Table').repaint()

event.source.parent.getComponent('Power Table').selectedRow = -1

```

[PowerTable\_edited\_cell\_color\_2020-03-14\_0832.zip](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/7ed8ce84c5b980f605b4b0d2271c656780b6e83f.zip) (20.3 KB)

---

<div class="post-metadata">

**Author:** ![anon55648468](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@anon55648468](https://forum.inductiveautomation.com/u/anon55648468)\
**Post date:** [March 15, 2020, 7:00pm UTC](https://forum.inductiveautomation.com/t/power-table-cell-color/33082/3 "2020-03-15T19:00:48Z")

</div>

Wow Jordan, thank you very much! The mirrored dataset to highlight if a value has changed is a lovely solution, this is exactly what i was looking for
