Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by RamaRao R on Nov 24, 2009 22:29
open dhtmlx forum
Addtional parameters in JSON object in Tree

As of now, We are pretty much ok with tree.

I am looking for:

1. Addition parameters - I want to have a additional parameters from JSON which can hold the node data:

{id: 1, text: 'Company', open: 1, im0: 'EntityStatus-Forward.gif', im1: 'EntityStatus-Forward.gif', im2: 'EntityStatus-Forward.gif', NODEDATA:'abc||xyz||123||$#@'}// I mentioned NODEDATA for your consideration.

Is there any JSON attribute to add additional data some thing like(NODEDATA)? If yes, how to call that data?

Please let me know your thoughts and send me the Tree JSON complete format with all attributes.

Thanks,

RamaRao R.

Answer posted by Alex (support) on Nov 25, 2009 01:50

It is possible to use userdata in the json:

{id: 1, text: 'Company', open: 1, im0: 'EntityStatus-Forward.gif', im1: 'EntityStatus-Forward.gif', im2: 'EntityStatus-Forward.gif', userdata:[{name:"nodedata", content:"abc||xyz||123||$#"}]}

var data = tree.getUserData("1","nodedata");