View Full Version : How to make a TreeLoader request json encoded??

14 Jul 2009, 11:12 AM
Hi !

I am currently using the tree with the treeloader to load a complete tree, which works fine. Now, I'll change it so, that it loads only the basic nodes and on request, loads leafes.

The problem for me is, that the outgoing request stays "application/x-www-form-urlencoded; charset=UTF-8", but I need it to be "application/json".

I could not figure out any way to make this change!

For a jasonstore, the following code made this change for me:

Ext.Ajax.on('beforerequest', function(conn, o)
var p = o.params;

// Convert the object to a string so that the params are not url-encoded.
if(typeof p == "object")
o.params = Ext.util.JSON.encode(p);
This does not work fro the treeloader. There seems to be no property to make this change?? I searched in the FAQs and the forums, but could not find anything!

The treeloader becomes unusable for me for use with webservices. I need the build-in parameter-decoding.

Any help would really be great!