Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Abhijeet Anand on Mar 10, 2008 10:56
open dhtmlx forum
Issues with serializing a tree

This question is in continuation with the one I asked a couple of days back. The link for the previous question is below.
index.php?s=normal&q=2260&a=2847

I created a dynamic tree and I have added certain attributes to each node. Now when I try to serialize the tree it does not pick those attributes. It only picks the img and the color. How can I get the my attributes in the serialized xml string. I figured out that I have to make some changes in dhtmlxtree_xw.js , but I am not able to put the correct code.


Also I am noticing a strange behavior, sometimes when I try to save the tree (as in serialize) it gives the following exception.

uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMSerializer.serializeToString]"  nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame :: http://localhost:8080/RoadToData/web/js/dhtmlxtree_xw.js :: anonymous :: line 9"  data: no]

And when I try to play around, like expand, collapse or delete some node and again press Save, it starts working. What can be the issue..?

Thanks.

Answer posted on Mar 11, 2008 02:29
>> but I am not able to put the correct code.

In case if you modified tree code in the way mentioned in original topic, you can modify serialization as

dhtmlxtree_xw.js , linen 108+ , code in bold need|may be added

out='<item id="'+itemNode.id+'" '+(this._getOpenState(itemNode)==1?' custom1="'+this.itemNode.attrs.custom1+'" open="1" '

>>I try to save the tree (as in serialize) it gives the following exception
This is caused by problem with serialization of not-parsed XML branches ( most probably you are using smart xml parsing mode )
Please contact us directly at support@dhtmlx.com - we will provide latest version of js file, which must resolve issue.