Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: text.data-foo doesn't work for JSON format #169

Open
Pefren opened this issue Aug 12, 2021 · 3 comments
Open

Bug: text.data-foo doesn't work for JSON format #169

Pefren opened this issue Aug 12, 2021 · 3 comments

Comments

@Pefren
Copy link

Pefren commented Aug 12, 2021

Hey. I use JSON to build the tree, use data-foo but don't see data-foo attribute anywhere on the page (using searchbox). Btw I want to make tooltips and pass strings to custom data-tooltip attributes
I use 1.0.1 treant version and anything else i need works great.
Thoughts?

image

@Pefren
Copy link
Author

Pefren commented Aug 12, 2021

I decided to use innerHtml instead of text...

@TimBurris
Copy link

i faced the same issue here in 2023, turns out, the "release" and also cdnjs have not been updated in forever. however, if you pull the Treat.js file from github directly, it does seem to work (for me).

moral of the story, don't trust cdnjs or even the github releases to be up to date.

@egor-progger
Copy link

I ported treantjs to Typescript. You can try https://www.npmjs.com/package/pointlinejs.
@Pefren in your case need add double quotes for attribute name.
Instead:

{
  text: {
    data-foo: "Tooltip data"
  }
}

need:

{
  text: {
    "data-foo": "Tooltip data"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants