first of all, you must modify your JSON to the structure which will accept the tree.
In your JSON there is property id for each object. this id property must be unique, in your case you have group id:1 and device id:1. this must be changed during data modification.
here we are creating models and modifying JSON recursively to achieve desired data structure.
first of all, you must modify your JSON to the structure which will accept the tree. In your JSON there is property id for each object. this id property must be unique, in your case you have group id:1 and device id:1. this must be changed during data modification.
here we are creating models and modifying JSON recursively to achieve desired data structure.
NOTE mType property which will define a model for node. see fiddle, also documentation for treepanel