-
9 Dec 2008 11:49 AM #601
Is it possible to set path and rootpaht dynamically
Is it possible to set path and rootpaht dynamically
From an event in a grid, is it possible to set dynamically the path and rootpath of the uploadpanel and the FileTreePanel ?
I found how to refresh the filetreepanel, but I'd like it to show specific directories only, depending on the current row of the grid.
Any hint to achieve this is Welcome!
-
9 Dec 2008 5:54 PM #602
PHP Code:tree.getRootNode().path = '/new/path';
tree.getRootNode().reload();
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
-
17 Dec 2008 6:05 AM #603
Adding columns to Tree
Adding columns to Tree
Hi Saki, thank you for this awesome component. What I'm trying to do is to add columns to the tree, to add some information such as number of files in a folder, or file size, for example.
Can you give me some pointers?
Thank in advance.
-
17 Dec 2008 7:30 AM #604
File size is already there - in tooltip. Be in your shoes, I'd deliver the information from server and displayed in tooltip. This is unbelievably easy.
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
-
17 Dec 2008 8:27 AM #605
About columns
About columns
Yes, I found the tooltip, but what about adding columns?
-
17 Dec 2008 9:28 AM #606
I don't use column trees at all => I don't know.
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
-
17 Dec 2008 2:21 PM #607
Question about adding listeners
Question about adding listeners
I noticed that if add a listener to the contextmenu event after the treepanel object has been created my handler is not fired. However if I add the listener in the constructor it does work. Is this intended?
For example this works:
But this doesn't:PHP Code:var treepanel = new Ext.ux.FileTreePanel({
height: 400
, width: 300
, url: 'filetree.ashx'
, id: 'ftp'
, title: 'Share files'
, renderTo: 'treepanel'
, rootPath: 'root'
, topMenu: true
, listeners: { 'contextmenu': function() { console.log('clic'); } }
});
Am I missing something?PHP Code:var treepanel = new Ext.ux.FileTreePanel({
height: 400
, width: 300
, url: 'filetree.ashx'
, id: 'ftp'
, title: 'Share files'
, renderTo: 'treepanel'
, rootPath: 'root'
, topMenu: true
});
treepanel.on( {'contextmenu': function() { console.log('clic'); } });
-
17 Dec 2008 6:57 PM #608
These should be equivalent...
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
-
18 Dec 2008 4:36 PM #609
Found the problem. The built-in 'onContextMenu' handler is returning a false value after executing. If you change it to true then it works (line 1125):
I tested it in Chrome, Firefox 3, Opera, IE7 and I didn't notice any side effects of changing that value (in Windows)PHP Code:onContextMenu: function(node, e) {
if (this.readOnly) {
return false;
}
this.showContextMenu(node);
return true; //I changed this to true
} // eo function onContextMenu
-
18 Dec 2008 5:00 PM #610
My 2 cents
My 2 cents
What do you think of adding an 'alias' attribute for tree nodes?
In the project that I'm working some of the 'physical directory' names are different, but for usability purposes I am displaying a 'User-friendly' name.
When the FileTreePanel executes a GET cmd, the server response normally looks like this:
However, let's say for example we have a directory in the server called 'ftrpnl' but I want my users to see 'File Tree Panel' instead. Hence the response from the server would be:PHP Code:[{"text":"simple_folder","iconcls":"folder","disabled":false,"leaf":false}]
To make this work I updated the getPath method so that it first looks at the alias attribute (if defined). If alias is undefined is assumed that the directory name is identical in the server.PHP Code:[{"text":"File Tree Panel","iconcls":"folder","disabled":false,"leaf":false, alias:'ftrpnl'}]
It is a simple change, (two lines of code):
I called the new attribute alias, but I'm open for ideas for other name (serverName, name, link, etc..)PHP Code:/**
* returns path of node (file/directory)
* @private
*/
, getPath: function(node) {
var path, p, a;
// get path for non-root node
if (node !== this.root) {
p = node.parentNode;
a = [node.attributes.alias || node.text]; //changed vmorale4
while (p && p !== this.root) {
a.unshift(p.attributes.alias || p.text); //changed vmorale4
p = p.parentNode;
}
a.unshift(this.root.attributes.path || '');
path = a.join(this.pathSeparator);
}
// path for root node is it's path attribute
else {
path = node.attributes.path || '';
}
// a little bit of security: strip leading / or .
// full path security checking has to be implemented on server
path = path.replace(/^[\/\.]*/, '');
return path;
} // eo function getPath
It would be great if you could incorporate that change


Reply With Quote
