[OnMouseIn Event][Hint display]


#1

Hi,

Context
I have a functionning tree where the OnMouseIn event is bind. for each node, the first time we place the mouse on the node, we do a server request to retrieve the hint to display.
Our trees can grow to 200+ elements, and thus, just by passing on the tree, we can send a lot of requests to the server.

Thus, I am trying to delay the call, which means :

  • you have to wait 500ms with your mouse on the node(value is not important here, it’s an example), and then the server request is made.
  • if you mouse out of the node, the call is cancelled and no request is sent.

I manage to get this done using the following piece of code

setTimeout(function () { this.doOnMouseIn(aIdItem); return true;}.bind(this), 500);

however now, I am facing another problem, which is that the hint is not displaying once the response is received.

Questions
Is there a better way to fulfill my need natively in your tree component?
Is there a function that can trigger the hint display?

Thanks for your time
I remain available for any other question you may have.

Florian.


#2

there is in-built possibility to display the tooltips in the dhtmlxTree:
https://docs.dhtmlx.com/tree__nodes_manipulation.html#itemstexttooltipcolormanipulation
You may define the required tooltip right in your dataset:

<item text="text" tooltip="tooltip" id="item_id">