how to set userdata with JSON string

I encounter some problems with loadJSONObject() method in how to construct the JSON string to include user data. As I know, the user data is perfectly supported by loadXML() via a xml tag, ‘’, but I don’t know how to do that with loadJSONObject() and JSON string. Can someone help me out? Thank you.

JSON reflect structure of XML object, so it will be

{id:0,item:[
   {id:1,text:“1111”, userdata: [{ name:“some_name”, content:“some_value”}] }
]}

Hi,

I’m having problems with getuserdata + json. I’ve send next json:

{“item”:
[
{“text”:“text1”,
“item”:[{
“text”:“text1_1”
“item”:[],
“id”:“4”,
“userdata”:[{“tel”:“ddd”}]
}],
“id”:“2”,
“userdata”:[{“tel”:“ddd”}]},
}],
“id”:“0”}

That prints perfectly, but when I raise
Object_Organigrama_tree.getUserData(id,“tel”) it returns “undefined”.
Is there any bug like in this post? dhtmlx.com/docs/products/kb/ … 20userdata
(Is the same as I’m aiming but for dhtmlxgrid)

Thanks



Change userdata syntax to the
“userdata”:[{“name”:“tel”,“content”:“ddd”}]
with such way of data declaration it will work correctly.

oh, thanks a lots . solution my problem