Perspective Equipment Schedule: Getting item id on click

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:

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.

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

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

image

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

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

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

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...

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.

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?

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.

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.

1 Like

I would love to see this

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}

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

Go ahead and submit a request/idea: https://ideas.inductiveautomation.com/

onClick on Item in equipment schedule is essential

1 Like