JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Gantt Is there an event that fires when a connection is removed? Reply To: Is there an event that fires when a connection is removed?

#111957
Adam Dawes
Participant

Hi Markov,

Thank you for highlighting this, I had overlooked that connections were treated as items too. That event does indeed fire with the type set as you describe.

However I’m having trouble identifying which actual tasks were on each side of the connection. For example, for a connection I have deleted in testing, the detail object shows me the following:

  • id: “16-17-1”
  • item.source: 16
  • item.target: 17
  • item.type: 1
  • type: “connection”

That’s all great, but it’s not including my task id values for the source and target tasks. The 16 and 17 appear to be internal indices into the Gantt chart tasks. How can I obtain the actual underlying task items from these two values in order to read their properties?

I tried using the getConnections and getConnectionDetails methods to find the connection by its id (the data returned by these methods includes everything I need) but the deleted connection has already been removed by this point and is not recognised by either method. I tried calling getTask(event.detail.item.source) but this just returned undefined.

What am I missing?

Thanks,

Adam.