I’m building a dynamic ExtJS form based on JSON data loaded from an ASP.NET web service. The problem I find is that ExtJS expects the JSON in a specific format, ie.
{ 'metaData': { 'title': 'Testing' }, 'data': [], 'success': true }
When using an ASP.NET web service to return an object as JSON it returns with the first element ‘d’, ie.
{ 'd': { 'metaData': { 'title': 'Testing' }, 'data': [], 'success': true } }
Is it possible to tell the ExtJS form to use ‘d’ as the root node?
After some more testing I’ve found that the ExtJS form does load the JSON from my web service but because the response text doesn’t have ‘success’: true in the root it is handled by the ‘failed’ handler. Fortunately this handler accepts the same parameters as the ‘success’ handler so can be manipulated the same.
Here’s an example of my form load handler: