PDA

View Full Version : JSON Format returned from Ext.Direct (TreeLoader component)



Enygma
30 Jun 2010, 12:25 AM
Hi I'm trying to update an application to using Ext.Direct, which was going just fine until I got to the TreePanel.
I'm using extdirect4dotnet.

I took a look at the Tree example for Ext.Direct and the response comes back as a JSON object i.e.:


{
"type": "rpc",
"tid": 2,
"action": "TestAction",
"method": "getTree",
"result": [etc...]
}


However, when I call my getTree method using extdirect4dotnet all the responses come back as an array:


[
{
"type": "rpc",
"tid": 3,
"action": "Tree",
"method": "GetTree",
"result": [ etc...]
}
]


This works fine for regular Direct Method calls where I define my own response handler, however for TreeLoader I don't think you can do that can you? Can anyone point me in the right direction?

Thanks

milanz
30 Jun 2010, 11:45 AM
Result should be an array of objects:

{"type":"rpc","tid":5,"action":"Menu","method":"getTree","result":[{"id":"id","type":"class","text":"Name","code":"WEB401","leaf":false,"expanded":true}]}

Need a bit more info to tell what could be wrong (complete treepanel code and server side method).