Skip to content

Ports: How to I set the text content of a span tag using a selector? #2673

Answered by kumilingus
cam-m asked this question in Q&A
Discussion options

You must be logged in to vote

You can use html attribute to insert any HTML e.g a text.

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 html attribute is now documented: https://docs.jointjs.com/api/dia/attributes/#html

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cam-m
Comment options

Answer selected by cam-m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants