ssuite
Junior Member
Posts: 2
Registered: 12/14/2005
Member Is Offline
|
| posted on 12/14/2005 at 08:37 AM |
|
|
Expanding node on single click - the text link
Hello.
I have seen several posts on this and found where you're pointing people in the documentation. "Node open on single click".
I have tried all of your tree demos out in IE 6 & Firefox 1.5 on the PC. Also Safari 2.0.2 & Firefox 1.5 on the Mac. I would say that all
browsers are on their "default" settings.
The functionality where clicking on the text "link" with a single click to expand that folder does not work on any of my browsers. It always
requires a double-click. I was expecting to see the single-click work for the text link in demo 4 - but it does not in any. The only functionality
that works with a single click is clicking on the plus/minus sign to the left of the folder.
Please advise. I need to get the single-click setup working for the text links in my menu.
Could you please point me to a demo where this is definitely supposed to work like that?
Thanks a lot.
|
|
|
rock
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 12/20/2005 at 01:01 PM |
|
|
Are you using PRO version?
|
|
|
ssuite
Junior Member
Posts: 2
Registered: 12/14/2005
Member Is Offline
|
| posted on 12/21/2005 at 01:22 PM |
|
|
Yes I am.
As I've said though, I'm not able to see this same functionality in any of the samples of your site using the browsers I've mentioned.
|
|
|
tigra
Administrator
Posts: 1982
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 7/5/2007 at 02:19 PM |
|
|
sample tree_tpl.js for single click nodes opening
| Code: |
/*
Feel free to use your custom icons for the tree. Make sure they are all of the same size.
If you don't use some keys you can just remove them from this config
*/
var tree_tpl = {
// general
'target':'_blank', // name of the frame links will be opened in
// other possible values are:
// _blank, _parent, _search, _self and _top
// icons - root
'icon_48':'icons/folder.gif', // root icon normal
'icon_52':'icons/folder.gif', // root icon selected
'icon_56':'icons/folder.gif', // root icon opened
'icon_60':'icons/folder.gif', // root icon selected opened
// icons - node
'icon_16':'icons/folder.gif', // node icon normal
'icon_20':'icons/folderopen.gif', // node icon selected
'icon_24':'icons/folderopen.gif', // node icon opened
'icon_28':'icons/folderopen.gif', // node icon selected opened
'icon_80':'icons/folderover.gif', // mouseovered node icon normal
'icon_88':'icons/folderopenover.gif',
// icons - leaf
'icon_0':'icons/page.gif', // leaf icon normal
'icon_4':'icons/pagesel.gif', // leaf icon selected
'icon_64':'icons/pagesel.gif', // leaf icon selected
// icons - junctions
'icon_2':'icons/joinbottom.gif', // junction for leaf
'icon_3':'icons/join.gif', // junction for last leaf
'icon_18':'icons/plusbottom.gif', // junction for closed node
'icon_19':'icons/plus.gif', // junctioin for last closed node
'icon_26':'icons/minusbottom.gif',// junction for opened node
'icon_27':'icons/minus.gif', // junctioin for last opended node
// icons - misc
'icon_e':'icons/empty.gif', // empty image
'icon_l':'icons/line.gif', // vertical line
// styles - root
'style_48':'mout', // normal root caption style
'style_52':'mout', // selected root caption style
'style_56':'mout', // opened root caption style
'style_60':'mout', // selected opened root caption style
'style_112':'mover', // mouseovered normal root caption style
'style_116':'mover', // mouseovered selected root caption style
'style_120':'mover', // mouseovered opened root caption style
'style_124':'mover', // mouseovered selected opened root caption style
// styles - node
'style_16':'t0ic', // normal node caption style
'style_20':'t0ic', // selected node caption style
'style_24':'t0ic', // opened node caption style
'style_28':'t0ic', // selected opened node caption style
'style_80':'t0io', // mouseovered normal node caption style
'style_84':'t0io', // mouseovered selected node caption style
'style_88':'t0io', // mouseovered opened node caption style
'style_92':'t0io', // mouseovered selected opened node caption style
// styles - leaf
'style_0':'t1io', // normal leaf caption style
'style_4':'t1io', // selected leaf caption style
'style_64':'t1ic', // mouseovered normal leaf caption style
'style_68':'t1ic', // mouseovered selected leaf caption style
'onItemSelect':'onItemSelectHandler'
// make sure there is no comma after the last key-value pair
};
/*
This function modifies tree behavior so nodes without link
assigned will open on single click
Function should be called AS onItemSelect handler of the tree
*/
function onItemSelectHandler (o_item) {
// if node with no link then toggle
var o_state = o_item.state();
if (o_state['node'] && !o_item.a_config[1]) {
o_item.o_root.toggle(o_item.n_id);
// cancel default action
return false;
}
// proceed to default handler
return true;
}
|
|
|
|
eagle79
Junior Member
Posts: 4
Registered: 6/11/2004
Member Is Offline
|
| posted on 7/23/2007 at 03:27 PM |
|
|
Doesn't work for me...
I apologize if I'm hijacking this thread, but this doesn't seem to work for me. We have the PRO version of the tree menu, and I've added this to my
tree_tpl.js file almost verbatim. But when I click my link now, I end up getting a 404/Not Found error, because my browser is now attempting to access
http://[my-server]/[my-folder]/null (which of course, does not exist).
Inserting window.alert calls into the onItemSelectHandler makes me think this is happening whenever o_item.state() is called.
|
|
|
tigra
Administrator
Posts: 1982
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 7/23/2007 at 08:44 PM |
|
|
try
if (o_state['node'] && o_item.a_config[1]) {
instead of
if (o_state['node'] && !o_item.a_config[1]) {
not sure how it got there
|
|
|
eagle79
Junior Member
Posts: 4
Registered: 6/11/2004
Member Is Offline
|
| posted on 7/23/2007 at 10:09 PM |
|
|
No change. The original conditional looks right to me, anyway, since I only want to toggle folder state if the link is null.
But it seems to be happening during the call to o_item.state().
If I add the following to the top of the event handler:
window.alert("testing...");
window.alert(o_item.state());
window.alert("still testing...");
And then try it, I get the first message ("testing..."), then I get a 404. I never get the third message ("still testing...")
|
|
|
tigra
Administrator
Posts: 1982
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 7/23/2007 at 10:23 PM |
|
|
Right. having the case of Mondays...
Well, this code worked fine previously. Make sure you use original tree.js.
If it looks fine then submit a support ticket attaching all the files in zip package and we'll take a look.
|
|
|
eagle79
Junior Member
Posts: 4
Registered: 6/11/2004
Member Is Offline
|
| posted on 7/24/2007 at 12:44 PM |
|
|
Okay. Will do.
-Thanks.
|
|
|
tigra
Administrator
Posts: 1982
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 7/24/2007 at 03:12 PM |
|
|
Apparently it was too old version of the script.
|
|
|