This is because it is not possible to use something like the code below (after JSON write the defaults object will be empty):
var treeConfig = new OpenLayers.Format.JSON().write([{
nodeType: "gx_layercontainer",
defaults: { defaultUI: GeoServices.tree.LayerNodeUI },
expanded: true
}], true);
So we need to do something like this on the loader:
loader: new Ext.tree.TreeLoader({
uiProviders: {'geoservices': GeoServices.tree.LayerNodeUI},
clearOnLoad: true
}),
and then use something like:
defaults: { uiProvider: 'geoservices' },
in the treeConfig.
But this does not work out of the box however. I need to investigate why this is not working.