Hi, currently I'm using XStream to convert Java objects into JSON, and it works fine for grids and everything else. The problem with using a treestore is that XStream's format (example 1) doesn't match ExtJs' (example 2) exactly. What is the best way to either tell the treestore how to read the different format, or at least reformat the json data as it comes during load()?

I can get closer if i fudge example 1 by changing the top name to "children" and having the root defined as '["children"]["NodeType"]' but it looks like it breaks when it gets to the final leaf with "Cannot read property 'NodeType' of undefined".

Thoughts?

Example 1: XStreams result, it wants to preface the array with the type of objects it holds, so if i send the data back it knows how to deserialize it.
PHP Code:
{
    
"data": {
        
"NodeType": {
            
"text""1-1",
            
"leaf"false,
            
"children": {
                
"NodeType": [
                    {
                        
"text""1-0",
                        
"leaf"false,
                        
"children": {
                            
"NodeType": [
                                {
                                    
"text""1-0-0",
                                    
"leaf"true
                                
}
                            ]
                        }
                    }
                ]
            }
        }
    }

Example 2: Works with ExtJs 4
PHP Code:
{
    
"children": [
        {
            
"text""1-1",
            
"leaf"false,
            
"children": [ 
                {
                    
"text""1-0",
                    
"leaf"false,
                    
"children": [
                        {
                            
"text""1-0-0",
                            
"leaf"true
                        
}
                    ]
                }
            ]
        }
    ]

Thanks in advance.