Hi,
i create my tree using XML and I set some attribute, example:
…
If the id of item is unique there is no problem, but if the id is repeated when I execute tree.getAttribute(my_id, “idPage”) I obtain “undefined”.
I know that if I replicate an id I get an id equals to “id + timestamp” but I expect that the attributes I setted via XML can be get via javascript.
Hi
To reproduce locally we need direct link or completed demo. docs.dhtmlx.com/doku.php?id=othe … leted_demo
If you have PRO version - please, create ticket in the support system or attach demo in PM
Hi,
you can find a demo.
I have a PRO version, but I think that this problem can help someone other.
If you want I can also open a ticket.
How try the demo:
Every time you click on a tree element I print the attribute “idPage”.
Now open “first page”
open “first section”
open “fourth button”
Now if you click “inner page” (id=“P72”, not unique into the xml-tree) you get “undefined”
Conditions of the license excluded addition the files of the PRO version on a forum for a free access. Therefore I downloaded your archive and deleted it. Wait for the answer, please.
Hi Dayra,
thanks for reply.
About the problem, I must have the possibility to set more times the same element. My tree is a “tree navigation” where I can have more “homepage” and a page can redirect to a homepage, so that homepage is contained twice into the tree.
I don’t understand why I can’t get an attribute for an element tree that has contained twice or more times into the tree.
I can concatenate the id and all my attributes to obtain an “unique id” and after splitting the “unique id” to get the id and all its attributes. But this is a bad programming and I don’t want do this.
Michele
I already use it, you could find it into the “complete demo” (before you removed it from my second post).
If you want I can send the demo in a private message.
Mmmh, I’m sure that you code is correct, but I don’t want to put an underscore character ‘_’ to make an item unique.
If I have the same item three or more times I don’t want to put another and another underscore character to make the elements unique.