Perspective Equipment Schedule Render Error

Hello!

I am getting a render error when I am using the equipment schedule in perspective.
The schedules items have a property binding to the table on the left.
When a user clicks on the table the idea is to show the orders from that production line during the timeframe bound to the equipment schedule. This works fine.
The events are property bound to the items which in turn fetches the same data as the items but process them differently.
The problem is when a user switches to another production line, some of the events get stuck in the visual element but they don’t exist inside the schedule.


This first image shows the general idea and that the order has ran two times in production.


In this next image we can see that the order 100049778 is still here. Even though it does not exist in the scheduled events array. Also notice that even though I changed the time frame from 1 hour to 6, the scale and location of the false event is the same.

This is also true when using it in the browser and this happens for multiple orders from different lines.
Not always though.


Here is an example where the events are stuck in each others production lines.

The only solution I have found so far is to refresh the browser or in the designer, toggle between design and preview mode.

Has anyone else experienced a similar problem? Or a solution?

Below are the scripts I am using.
The first one is the items script propertybound to a custom property in the table which fetches from a the orders from the database. It goes through the orders and populates the items where I ignore the duplications so I only get 1 item.

items = []
orderNr = 0
for row in range (value.getRowCount()):
	if value.getValueAt(row, "BeginTime") >= self.custom.SelectedStartDate and value.getValueAt(row, "EndTime") <= self.props.dateRange.endDate:
		if value.getValueAt(row, "Order") != orderNr:
			orderNr = value.getValueAt(row, "Order")
			items.append(
			  {
				"id": orderNr,
				"label": orderNr,
				"iconConfig": {
				  "path": "",
				  "color": "",
				  "style": {}
				},
				"headerStyle": {
				  "classes": "",
				  "fontSize": 20
				},
				"rowStyle": {
				  "classes": ""
				}
			  })

return items

This is the other script which goes through the same data and populates the events.
TL stands for time length. Our data have a lot of small orders that we filter away.

events = []
Data = self.getSibling("ProductionLineTable").custom.SelectedOrderData
for row in range(Data.getRowCount()):
	for item in self.props.items:
		if item.id == Data.getValueAt(row, "Order"):
			tl = system.date.minutesBetween(Data.getValueAt(row,'BeginTime'),Data.getValueAt(row,'EndTime'))
			if tl > 29:
				events.append(
				{
					"itemId": Data.getValueAt(row, "Order"),
					"eventId": Data.getValueAt(row, "Order"),
					"startDate": Data.getValueAt(row, "BeginTime"),
					"endDate": Data.getValueAt(row, "EndTime"),
					"label": Data.getValueAt(row, "Order"),
					"leadTime": 0,
					"leadStyle": {
						"classes": ""
					},
					"percentDone": 0,
					"style": {
						"classes": "",
						"backgroundColor": "#00A8FF"
					}
				})

#system.perspective.refresh()
return events

try to seperate EventId and ItemId to different values

Yes, seperating the ItemId and the EventId seem to solve the issue. However I assume they should not be linked since EvenId is only a unique identifier while ItemId is bound to items. Is this intentional?