Ports: How to I set the text content of a span tag using a selector? #2673
-
IntroductionI'm using a foreignObject in markup for a port, but I can't work out how to set the text content of a span?
What I want is html like this:
Using
Using
The js for adding the port is like this:
Does your question relate to JointJS or JointJS+. Select both if applicable.JointJS |
Beta Was this translation helpful? Give feedback.
Answered by
kumilingus
May 29, 2024
Replies: 1 comment 1 reply
-
You can use this.addPort(
{
group: LIST_GROUP_NAME,
attrs: {
propertyName: { html: 'MyPropertyName'},
propertyType: { html: 'MyPropertyType'},
}
}
); I am sorry, it's currently not mentioned in the docs. We will update. Edit: The |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
cam-m
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use
html
attribute to insert any HTML e.g a text.I am sorry, it's currently not mentioned in the docs. We will update.
Edit: The
html
attribute is now documented: https://docs.jointjs.com/api/dia/attributes/#html