# Component layer

**URL:** <https://forum.inductiveautomation.com/t/component-layer/15880>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [November 4, 2017, 1:27pm UTC](https://forum.inductiveautomation.com/t/component-layer/15880 "2017-11-04T13:27:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lyhkch](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lyhkch/32/9381_2.png) [@lyhkch](https://forum.inductiveautomation.com/u/lyhkch)\
**Post date:** [November 4, 2017, 1:27pm UTC](https://forum.inductiveautomation.com/t/component-layer/15880/1 "2017-11-04T13:27:46Z")

</div>

Hi , I want to control component layer by script , such as Easy Chart , Template , Alarm Status Table …  
How can I do ? not by button of “Move to front”, “Move to back”

---

<div class="post-metadata">

**Author:** ![samngeru](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/samngeru/32/6007_2.png) [@samngeru](https://forum.inductiveautomation.com/u/samngeru)\
**Post date:** [November 4, 2017, 4:00pm UTC](https://forum.inductiveautomation.com/t/component-layer/15880/2 "2017-11-04T16:00:53Z")

</div>

This script is on a button.

```auto
component = event.source.parent.getComponent('Easy Chart')

rootContainer = event.source.parent
currentZOrder = rootContainer.getComponentZOrder(component)

try:
	#Change the minus to a plus to move the Z Order/Index of the Object/Component to a higher 'layer'
	rootContainer.setComponentZOrder(component,currentZOrder - 1)
	component.requestFocusInWindow()
except:
	pass

```

---

<div class="post-metadata">

**Author:** ![lyhkch](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lyhkch/32/9381_2.png) [@lyhkch](https://forum.inductiveautomation.com/u/lyhkch)\
**Post date:** [November 4, 2017, 5:54pm UTC](https://forum.inductiveautomation.com/t/component-layer/15880/3 "2017-11-04T17:54:36Z")

</div>

Thanks! It’s OK NOW.
