Create Tooltip Unique in every cell element created #1725
Unanswered
pandika-csgi
asked this question in
Q&A
Replies: 1 comment 1 reply
-
How about creating only a single tooltip instance: new ui.Tooltip({
/* ... */
target: `[data-tooltip]`,
}); And if you need to display a tooltip programmatically, you can do: labels.push({
attrs: {
selector1: {
//...
'data-tooltip': 'Tooltip 1',
},
selector2: {
//...
'data-tooltip': 'Tooltip 2',
}
}
}); And then find the label node on the linkView and show the tooltip. const linkView = link.findView(paper);
const labelIndex = 0;
const target = linkView.findLabelNode(labelIndex, 'selector1');
tooltip.show({ target: target }); Perhaps I just don't understand what are you trying to achieve. What do you mean show all tooltips? At the same time? Note, that you can create a unique selector for any of the cell's node if needed e.g. const CSSSelector = `.joint-cell[model-id=${cell.id}] [joint-selector="selector1"]` |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is the next part of my last discussion (#1716)
So, in my app if graph has changed event and value.member has value so I created an element and have tooltip inside that, I want to show all tooltip.
My idea is every change I want to create instance of
new ui.Tooltip
for every element I created, so innew ui.Tooltip
I need some unique id to target the element, maybe like this:and that unique id comes from
cell circle attrs
I created above.So I need that
unique_id
to bind my element with the tooltip and I can do a for each intooltips array
and callingshow() and hide()
.My question how to get that cell id or unique attribute to bind with my tooltip after I created it because in that circle after created got an id generate by rappid like
v-{number}
?or any approach to do like my case?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions