@adamdawes-comgmail-com
@adamdawes-comgmail-com
Forum Replies Created
-
AuthorPosts
-
December 16, 2024 at 11:36 am in reply to: Is there an event that fires when a connection is removed? #111965Adam DawesParticipant
Just for info I have managed to work around this by calling
getConnections
during theopening
event and caching the results, and then when theitemRemove
event fires, looking back in the cache to find the item with the provided connection id. This does allow me to then identify the tasks that were linked by the connection. It would be great if this data were available automatically however: the full information returned bygetConnectionDetails
should be available in theitemRemove
event (including thestartTask
andendTask
objects) rather than just the limited information currently available.December 13, 2024 at 1:22 pm in reply to: Is there an event that fires when a connection is removed? #111957Adam DawesParticipantHi 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
andgetConnectionDetails
methods to find the connection by itsid
(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 callinggetTask(event.detail.item.source)
but this just returnedundefined
.What am I missing?
Thanks,
Adam.
-
AuthorPosts