7 May 2008 11:32 AM #251
Take a look at the function onContextClick, that should be the only one you need to override.
9 May 2008 9:24 AM #252
Firstly - thanks for a fantastic plugin!
I've managed to get the FileTree working with a PHP backend, all the
various features are working OK. I can upload files, rename them,
create folders, delete, etc, however, I'm just getting a bit stuck
on the download side.
Just as a simple start, I'd like to download a file and display it in a window,
the file could just be text say.
I can see that on using Open->Download the FileTree POSTs with
cmd = 'download' and path='name of file', I didnt get any response
with Open though.
however, not sure what I should do at this point. Do I return the file
in JSON format, etc. How do I overload the 'open' and 'download'
etc events to say open a simple window with the file contents. I'd
prefer to do this without changing URL.
If you could give me a start on that it would be great.
9 May 2008 9:41 AM #253
You should return plain file data, not json encoded, with proper headers (content-disposition).
9 May 2008 10:05 AM #254
I'd like to return the data in AJAX style though, for example it would
be nice to open data in a separate window, perhaps a splitter on the
However when I click on Open in the menu, I dont get a message passed
through to the server just the request for the URL. I'd like to change
this to a 'getfile' type command, and return the data in JSON format
9 May 2008 12:46 PM #255
Saki, is there a reason why I can't force the initial request from FileTreePanel to be a 'get'? I am passing in method:'get', yet when I look in FireBug I see that it sends a POST (i guess that's default). is there anything else I need to do? thanks a lot.
10 May 2008 2:54 AM #256
10 May 2008 2:56 AM #257
10 May 2008 4:15 AM #258
Saki, is there a specific reason why you prefer "POST'? I am using Ruby on Rails and wish to stick to the 7 actions that REST provides (same URL with GET gives me a index action, wheereas with POST gives me create action). Anyway, I will try the capitalized 'GET' and let you know. thanks.
10 May 2008 5:42 AM #259
10 May 2008 6:43 AM #260
Thanks. I'm on a fairly steep learning curve here, I've got to grips somewhat with
ExtJs, but message/action passing still escapes me.
Could you show me how I would override the openNode behaviour. Do I subclass
FileTreePanel, and add a 'listener'?
I wanted to add some buttons to a toolbar which talked to the FileTreePanel, but
I had to call functions directly in the FileTreePanel to get it to work.