-
30 Apr 2008 3:34 AM #241
That would be wonderful. I am willing to test anything you come up with, thanks Saki.
-
30 Apr 2008 7:09 AM #242
Extending to look up by ID
Extending to look up by ID
Saki,
I am writing an application where my files are in DB. So, the relationship between files/folders in maintained in the DB. I was able to successfully retrieve tree data, based on a parent node that's passed in. But, for other commands (newdir, upload etc), I am wondering if there any way to also pass the ID of the files/folders to the server? Currently, I get "path" or "dir" and my server side logic doesn't have the "path" the way filetreepanel passes it (I don't store the entire path of a file/folder in D
. So, before deciding to make the server side change to store that, I was wondering if FileTreePanel could also additionally pass me the appropriate ID e.g. parent of new dir to add/
Any advice/suggestion is much appreciated. thanks a lot.
-
30 Apr 2008 9:07 AM #243
Once I thought that I'll put files to DB too but it has proven that is was not very lucky approach in my case. I ended up with having files in normal filesystem and all additional info is in DB (description, MD5 sum, etc...). If you can change your setup I'd be for this.
If you cannot..., hmmm, not easy w/o overriding some routines... FileTreePanel was designed to work with filesystem...
Maybe it would do if you override loader beforeload plus action methods (delete, rename, ....)Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
2 May 2008 5:58 AM #244
Thanks Saki. Maybe I'll start with saving the entire path of a file as a DB column. This way, I can easily lookup the file/folder based on that column.
-
4 May 2008 10:08 AM #245
Saki,
I was able to mimic the new folder creation on the server side (in DB ). The server now returns a JSON {"success":true} and creates the folder.
On the client side, the new folder name stays and gets a + icon. However, when I click on the +, I get the top level Folder again. It seems like the "node" being passed back isn't the same ID as the folder that was created (I get ynode-300 as the node value). Is there any way to get the new "get" request come with the newly created ID? thanks.Last edited by bomka; 4 May 2008 at 10:09 AM. Reason: the paranthesis after DB created a smiley icon
-
4 May 2008 10:14 AM #246
I ignore ids of nodes in the FileTreePanel whatsoever. The attribute that matters is path. Anyway, you can hook on an event and process the received id yourself if necessary.
Another important attribute is leaf. Leaf cannot have children, node (folder) can have children.Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
6 May 2008 11:55 PM #247
Hi Saki,
I noticed that the fireFinishEvents of the Ext.ux.FileUploader does not return the server's response.
I think that could be useful, for example in cases where the server assigns an id to the uploaded file:
where 'o' is json response from server and 'singlefilefinished' is a specific event for singleUpload mode.Code:,fireFinishEvents:function(options,o) { if(true !== this.eventsSuspended && this.singleUpload) { this.stopProgress(); this.fireEvent('singlefilefinished', this, o); } if(true !== this.eventsSuspended && !this.singleUpload) { this.fireEvent('filefinished', this, options && options.record, o); } if(true !== this.eventsSuspended && !this.singleUpload && 0 === this.upCount) { this.stopProgress(); this.fireEvent('allfinished', this); } }
Regards
Fausto
-
7 May 2008 1:30 AM #248
This could be problem only if you use singleUpload:true, do you? This event was meant only to let upper levels know that there is no upload in progress. You should listen to filefinished event for individual files and extract server data form passed arguments.
Jozef Sakalos, aka Saki
A lot of valuable info at:
Saki's Extensions and Plugins
Saki's Extensions and Plugins Docs
Saki's Examples, Latest: Grid in Card Layout
Saki's Blog, Featured: Writing a Big Application in Ext, Latest: Grid MultiSearch Plugin Video
-
7 May 2008 5:50 AM #249
Yes, I use FileUploader as component in another class, with singleUpload:true.
So I have to listen to allfinished event, the only that is fired, and, at this point,I can't retrive data from server.
In any case, I can be wrong, but the response from the server can be accessed only during the 'progress' event, (not sure that in filefinished event can be retrived the uploadCallback response.responseText/json).
-
7 May 2008 7:45 AM #250
Thanks, i got that to work. Another question I have is that i am planning to use FileTreePanel to display some other DB data as well. But, I need to override the display mechanism, i.e. if someone clicks on "New Customer", for example, it should display a Modal screen that allows users to enter various information.
So, basically my question is can still have FileTreePanel, use its' context menu, but provide my own handler functions? thanks.


Reply With Quote
