Board Logo

folders expand on single click
nidhi - 3/21/2005 at 10:33 AM

When persons click on the test name of a folder in the tree.aspx it should expand the contents of that folder.
Currently the user must click the + sign or doubleclick the folder name in order to make it expand.
Please make it so single click expands the folders in tree.aspx


rock - 3/21/2005 at 01:43 PM

You could easily make this by yourself using open tree API and event handling functionality.
For more details please refer to the product documentation (Node open on single click)


stevvi - 7/27/2005 at 09:52 AM

First off, apologies for being a total newbie...

I have found:

/*
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
if (o_item.a_config[3] && !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;
}

but where do I include the code? I've tried it at the bottom of tree_tpl.js and it doesn't seem to have any effect at all.

Any help would be appraciated.

Thanx


rock - 7/27/2005 at 02:22 PM

The function you've found in the documentation is a handler function so you should also associate it with tree event via template settings. To link the handler with select event you should add following pair to the TREE_TPL object:

'onItemSelect' : 'onItemSelectHandler'
//make sure there is no comma sign after last pair


stevvi - 7/27/2005 at 04:47 PM

Many thanx


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/