Hi all,
I am trying to insert a new lz.DataElement into a dataset, but I am
running into problems that it looks like are caused by a combination
of the name of an attribute in the element and the fact that the value
I am assigning to it is derived from another lz.DataElement's
attribute. I have tried adding the new element both by creating it
and using "appendChild()", and also by using a datapointer's
"addNode()" method with arguments.
The problem appears to be the fact that my new element must have an
attribute called "id," that I am setting dynamically. My code looks
something like this:
var ele = new lz.DataElement("newChild");
var temp = oldEle.getAttr("id");
ele.setAttr("id", temp);
root.appendChild(ele);
This code adds a childNode to my root lz.DataElement, but instead of
being a data element that looks something like '<newChild id="1"/>'
when I inspect the root node, the new node comes up as '>>"
onclick="$modules.lz.Debug.objectLinkHandler(event, 26)"><newChild
id="1"/>' The new node does not appear at all in my existing dataset.
If I change the attribute name to anything other than "id," it works
fine. If I directly assign a string or number to temp (e.g., 'var
temp="1"' or 'var temp=1') it also works fine, even though the
variable temp is typeof=string when I test it in my original code. Is
there a workaround for this issue?
Thanks,
Justin
--
Justin Ellis
646-783-9387
Fax: 866-448-6503
[email protected]
www.LightBulbLaw.com