Writing user data to JSON (bug in _serializeItemJSON ?)

I was having trouble persisting user data on nodes when serializing to JSON. I looked at the serialize function and noticed this in dhtmlXTreeObject.prototype._serializeItemJSON:

if(this._xuserData&&a._userdatalist) { … code that adds user data list to JSON … }

It looks like _xuserData is never defined anywhere, so this condition always fails and the user data is never written. I even did a grep through the whole dhtmlxtree directory and the only place _xuserData shows up is in that function. I just removed the this.xuserData and it seems to work fine. Was _xuserData used in the past, but removed in an update?

I was having trouble persisting user data on nodes when serializing to JSON

If you obtained PRO edition, you need to use setSerializationLevel method to enable userdata serialization (the method is included into dhtmlxtree_xw.js):

tree.setSerializationLevel(true);

If you are using Std edition, you may just set _xuserData true:
tree._xuserData = true;