[REACT] cellTooltip doesnt update when resrouceChanges values
Posted: Thu Jan 20, 2022 2:04 pm
by jbyvik
Heyo.
We are playing around with cellTooltips to display tooltip for our resources. When we are updating the resourcee with new Data, the tooltip doesnt reflect this change for some reason. Is there a cachee or smthn that needs to be cleared or what is happening here?
and to the eventTooltip onBeeforeshow we add a function to change the resources name. This is mainly to trigger a dataChange to the resource, not something we actually implement
You can see in the demo that the resource gets a new name but when hovered the tooltip still shows the old name. When you change resource it gets the new info.
Re: [REACT] cellTooltip doesnt update when resrouceChanges values
Posted: Thu Jan 20, 2022 5:20 pm
by Animal
The CellTooltip featre? OK, that will be primed with the resource record. The resource is the row.
But your onBeforeShow talks about tooltip.eventRecord. That's part of the EventTooltip feature. If you get no errors thrown, then I'm assuming that must be in the configuration of your EventTooltip feature.
So there are two features here and I'm a bit confused.
This happens which is what I expect. The Event tooltip shows, and the resource changes name.
itworks.gif (1.76 MiB) Viewed 363 times
Obviously the cell tooltip doesn't trigger on the schedule area. That's the ScheduleTooltip that you see. Hovering that first column shows the CellTooltip, and as I have configured above, it shows the resource name:
Screenshot 2022-01-20 at 16.18.48.png (13.45 KiB) Viewed 363 times
Re: [REACT] cellTooltip doesnt update when resrouceChanges values
Posted: Thu Jan 20, 2022 6:20 pm
by jbyvik
Haha yeah sorry, bad examples.
The feature we are wondering about is the cellTooltip
The issue seem to be that the cellTooltip resourceRecord is chached or saves something. Becuase if we trigger a cellTooltip over e.g. "Ellen" then (either with that cellTooltip closed or opened) we progaramtically change the resrouceRecord (e.g. resourceRecord.set name: 'hello world and then open the tooltip again the tooltip will still display Ellen as the resource Name. it corrects itself when we hover another cell and then hover our changed cell again.
so a actionflow here:
pic 1: hovering cell, everything is correct
pic 2: hovered eventTooltip, modifying resourceRecord setting new name. Works fine
pi3 3: hovered the resourceRecord again but issue here as the cellTooltip displays the previous name and not the modified name (hello world) which is also displayed on the row.
if I hover another cell to fire the tooltip and then hover HELLO WORLD cell again, it display helloWorld
The event tooltip features onBeforeShow was just used as a simple way to programatically change the resourceRecord, mby we should have added a btn instead ^^
Re: [REACT] cellTooltip doesnt update when resrouceChanges values
Posted: Thu Jan 20, 2022 6:41 pm
by Animal
Yes, I think the issue is that if you hover the same record instance, the content calculation thinks nothing has changed.