# Customizing Alarm status table

**URL:** <https://forum.inductiveautomation.com/t/customizing-alarm-status-table/61102>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [June 23, 2022, 9:22am UTC](https://forum.inductiveautomation.com/t/customizing-alarm-status-table/61102 "2022-06-23T09:22:53Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [July 18, 2024, 5:57am UTC](https://forum.inductiveautomation.com/t/customizing-alarm-status-table/61102/9 "2024-07-18T05:57:52Z")

</div>

> [@Koussaila\_Fekroune](#):
>
> where can I put my script

That old script is overdue for a refactor:

```python
# Written for the propertyChange event handler of an alarm status table
# The component running event only fires once when its component is first initialized
# It won't fire in the designer unless preview mode is on prior to opening the window
if event.propertyName == 'componentRunning':
		
	# Returns the first nested component of a given class
	# container = The object containing nested components to be recursively searched
	# className = the __name__ of the class given as a string
	def findComponentOfClass(container, className):
		for component in container.components:
			if component. __class__. __name__ == className:
				return component
			else:
				foundComponent = findComponentOfClass(component, className)
				if foundComponent:
					return foundComponent
	
	# Recursively find the inner table
	innerTable = findComponentOfClass(event.source, 'AlarmStatusTable$1')
	
	# Iterate through the table columns and conditionally change the header values in some way
	columnModel = innerTable.columnModel
	for column in xrange(innerTable.columnCount):
		tableColumn = columnModel.getColumn(column)
		if tableColumn.headerValue == 'Label':
			tableColumn.headerValue = 'Custom Alarm Name'
			
	# Repaint the table header
	innerTable.tableHeader.repaint()

```

This script was written for the `propertyChange` event handler of the Alarm Status table itself. Simply _ **right click on the alarm status table** _ in the designer. Then, _ **click on "Scripting"** _ in the popup that appears, and place the script in the propertyChange event handler:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/6/d6c9b7495d6281b004c3b5cc53df51410ebc17c1.png)

**Result:**  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/3/03b16c13c76acb3628be9c0e5c6cfd24cc2b1e86.png)

---

_[View the full topic](https://forum.inductiveautomation.com/t/customizing-alarm-status-table/61102)._
