DHTMLX tree does not set userdata automatically

this is JSON response from the server:

{
    "id" : "0",
    "child" : 0,
    "text" : "a",
    "userdata" : [],
    "item" : [{
            "id" : "1",
            "text" : "b",
            "item" : null,
            "child" : 1,
            "userdata" : [{
                    "name" : "data-code",
                    "value" : "23"
                }, {
                    "name" : "data-title",
                    "value" : "title1"
                }
            ]
        }
    ]
}

but dhtmlx tree plugin does not set user data and when i call tree.getUserData(1, ‘data-code’) it returns undefined. how can i solve this problem?

question on stack: [url]json - DHTMLX tree does not set userdata automatically - Stack Overflow

Hello
Try to use ‘name’ and ‘content’ instead of ‘name’ and ‘value’