# Perspective Equipment Schedule: Getting item id on click

**URL:** <https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [May 10, 2023, 6:11pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553 "2023-05-10T18:11:31Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![awaege1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/awaege1/32/28922_2.png) [@awaege1](https://forum.inductiveautomation.com/u/awaege1)\
**Post date:** [May 10, 2023, 6:11pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/1 "2023-05-10T18:11:31Z")

</div>

I am currently using the perspective equipment schedule component. There are several other forum posts regarding the click events to update/modify/delete schedule events that already exist in the component. These can be accessed via the component events as follows:

```auto
eventId = event.eventId
itemId = event.itemId

```

The issue that I am running into is that these properties are only accessible if you are clicking on an actual scheduled event. What I am trying to do is get a popup to display based on the item that is clicked on, without having to click on a scheduled event for the item (in this case there are no events scheduled so the item has no events). Is this currently possible to do? The documentation leads me to believe no, but I am not 100% sure.

---

<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:** [May 10, 2023, 6:25pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/2 "2023-05-10T18:25:36Z")

</div>

I'm not sure I understand. You want the id of an event but you don't have any ?

---

<div class="post-metadata">

**Author:** ![awaege1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/awaege1/32/28922_2.png) [@awaege1](https://forum.inductiveautomation.com/u/awaege1)\
**Post date:** [May 10, 2023, 6:38pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/3 "2023-05-10T18:38:48Z")

</div>

No, I want the id of the item that is clicked on. The component has properties for items and schedules:

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

Items in my case are the lines for the facility. Then "scheduleEvents" are the "events".

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [May 10, 2023, 6:52pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/4 "2023-05-10T18:52:30Z")

</div>

If an item is not a scheduledEvent or downtimeEvent, how would it even be displayed and therefore available for clicking?

---

<div class="post-metadata">

**Author:** ![awaege1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/awaege1/32/28922_2.png) [@awaege1](https://forum.inductiveautomation.com/u/awaege1)\
**Post date:** [May 10, 2023, 6:54pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/5 "2023-05-10T18:54:33Z")

</div>

Items can be displayed without having corresponding events though. Items are just the rows of the schedule:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/b/9b120fdea4b7579a9745cc0e92840bdaac09b903.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [May 10, 2023, 6:56pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/6 "2023-05-10T18:56:13Z")

</div>

Oh, I see, so you want this information when clicking the item - not a scheduledEvent or downtimeEvent for that item. Let me think about it for a bit...

---

<div class="post-metadata">

**Author:** ![awaege1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/awaege1/32/28922_2.png) [@awaege1](https://forum.inductiveautomation.com/u/awaege1)\
**Post date:** [May 10, 2023, 6:57pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/7 "2023-05-10T18:57:12Z")

</div>

Yes, in my case, the item id for each item is the equipment path. I want it so that when a user clicks an item, not an event, it calls a popup and passes in the equipment path associated with the item clicked.

---

<div class="post-metadata">

**Author:** ![Tim\_Carlton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim_carlton/32/52835_2.png) [@Tim\_Carlton](https://forum.inductiveautomation.com/u/Tim_Carlton)\
**Post date:** [May 10, 2023, 6:58pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/8 "2023-05-10T18:58:34Z")

</div>

The way that I read it, an Item is a piece of equipment that can be scheduled (recorded?) as a Scheduled Event, recorded as a Downtime Event, or recorded as a Break Event. An Event can respond to a Click Event (or mouse over, or touch start, or...).

If the row is selected or the row header is clicked then reasonable expectation is that the Item would be able to be clicked or touched and that an Event (UI event) could be scripted to do something (e.g., add a schedule event, start a downtime event, ...)

Does that sound reasonable?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [May 10, 2023, 6:59pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/9 "2023-05-10T18:59:27Z")

</div>

Unfortunately, no - I don't think you'll be able to do this with the Component's available functions as they are today. You could manage something along these lines with the Context Menu available to the Component, but it would not be trivial.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [May 10, 2023, 7:02pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/10 "2023-05-10T19:02:23Z")

</div>

> [@Tim\_Carlton](#):
>
> the row header is clicked then reasonable expectation is that the Item would be able to be clicked or touched and that an Event (UI event) could be scripted to do something (e.g., add a schedule event, start a downtime event, ...)

Sure, we can do (most) anything, and provide hooks into thousands of events per component, but each individual hook takes a lot of development time, and so we try to anticipate the most likely interactions. We could definitely add a new `onItemClick` Event as a feature request.

---

<div class="post-metadata">

**Author:** ![awaege1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/awaege1/32/28922_2.png) [@awaege1](https://forum.inductiveautomation.com/u/awaege1)\
**Post date:** [May 10, 2023, 7:03pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/11 "2023-05-10T19:03:02Z")

</div>

I would love to see this

---

<div class="post-metadata">

**Author:** ![Tim\_Carlton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim_carlton/32/52835_2.png) [@Tim\_Carlton](https://forum.inductiveautomation.com/u/Tim_Carlton)\
**Post date:** [May 10, 2023, 7:04pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/12 "2023-05-10T19:04:48Z")

</div>

OnDoubleClick has promise, but would require math to estimate the bounds of each row ... not particularly reliable perhaps in HTML5 and a flex container.

> dblclick self com.inductiveautomation.perspective.gateway.script.ComponentModelScriptWrapper$SafetyWrapper@6ede78e1, event {"type":"dblclick","eventPhase":3,"bubbles":true,"cancelable":true,"timeStamp":1020563,"defaultPrevented":false,"isTrusted":true,"detail":2,"screenX":-3630,"screenY":-144,"clientX":55,"clientY":693,"pageX":55,"pageY":693,"ctrlKey":false,"shiftKey":false,"altKey":false,"metaKey":false,"button":0,"buttons":0,"movementX":0,"movementY":0}

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [May 10, 2023, 7:06pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/13 "2023-05-10T19:06:10Z")

</div>

In case you don't want to wait and want to try and tackle this yourself, this thread would be a good place to start.  
[Perspective Scheduler - Drag and Drop From Table - Ignition - Inductive Automation Forum](https://forum.inductiveautomation.com/t/perspective-scheduler-drag-and-drop-from-table/71853)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [May 10, 2023, 7:11pm UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/14 "2023-05-10T19:11:26Z")

</div>

Go ahead and submit a request/idea: [https://ideas.inductiveautomation.com/](https://ideas.inductiveautomation.com/)

---

<div class="post-metadata">

**Author:** ![jrd](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jrd](https://forum.inductiveautomation.com/u/jrd)\
**Post date:** [January 30, 2024, 4:41am UTC](https://forum.inductiveautomation.com/t/perspective-equipment-schedule-getting-item-id-on-click/73553/15 "2024-01-30T04:41:10Z")

</div>

onClick on Item in equipment schedule is essential
