You'll have to create your own custom TreeLoader
class to construct the node names RESTfully in the url instead of passing 'node' as a param. As you can see from this example code, specifying your own TreeLoader
allows you to easily specify the HTTP request method.
root: new Ext.tree.AsyncTreeNode({
expanded: true,
loader: new Ext.tree.TreeLoader({
url: '/sample-data-toc.json',
requestMethod: 'GET',
preloadChildren: true
})
})
Dig into the TreeLoader
class and extend it to provide your own url scheme.
EDIT: after looking at the TreeLoader
source, it looks like you should override requestData
to properly set the url
based on the node
, and you'll probably want to change getParams
to either return nothing or any special query string params you have. Should not be too much work. When you're done, share back your RESTfulTreeLoader
with the community!