Smart Rendering with JSON based tree

Hi,

I have a tree that I load with JSON object and would like to enabled smart rendering on. However, when I do so I get error in the preParse():

“The item adf7a2db-71ac-4339-a900-2721a5f15d94 not operable. Seems you have non-unique|incorrect IDs in tree’s XML.”

My tree structure is {“id”:“0”,“item”:[{“id”:“adf7a2db-71ac-4339-a900-2721a5f15d94”,“text”:"Total ", “child”:“1”,“item”:[{“id”:“4e65d8fe-6456-4a0c-bbb7-3e8f4a7a4e8c”,“text”:“C2”,“child”:“1” …

or

Total

  • C2

with fake root node with id 0 around it since tree requires it.

In terms of the actual load my code pretty much follows
dhtmlx.com/docs/products/dht … .html#code

but instead of loadXML I do loadJSONObject.

I know for a fact that I do not have duplicate ids in my tree, and the ids do exist in the model. Could you point out what I am missing?

Thanks

Hi
Don’t you use enableSmartXMLParsing()?
These 2 methods are not compatible.

If you don’t use them both, please, provide us a direct link to your project to test the issue (or you can provide us completed demo on support@dhtmlx.com with a link to this topic).
docs.dhtmlx.com/doku.php?id=othe … leted_demo

I do not set smartXMLParsing to anything explicitly, however the source of enableSmartRendering() does this.enableSmartXMLParsing(true); So, how come those are incompatible then? Should I be doing:

tree.enableSmartRendering(true);
tree.enableSmartXMLParsing(false);

We tested locally on the next sample:
dhtmlxTree/samples/11_json_support/05_pro_smart_parsing_json.html
With the next changes:

  1. added
  1. replace
    tree.enableSmartXMLParsing(true);
    with
    tree.enableSmartRendering();
    It works fine.

May the issue is in child:1 in datasource. Dynamic loading is not compatiblewith smart rendering.