How to change a data attribute (li_attr)? #2722
Unanswered
florianwetzl
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
first of all: jstree is a great plugin and great work, thank you!
I try to change a data-attribute on an existing node in jstree, but no answer i find worked for me. I found this, didnt work: How to update data attribute in JSTREE?
.jstree(true).get_node(item_id).li_attr.data-opened-before = trueI get the error: "Uncaught SyntaxError: Invalid left-hand side in assignment" Can anybody help?
I do use li_attr to add the attribute in the first place: li_attr: {"data-opened-before" : "false"} I do this when i initiate the jstree and the data-attribute is drawn and visible in frontend sourcecode.
Greetings,
Florian
Beta Was this translation helpful? Give feedback.
All reactions