Board Logo

onclick
bird - 2/14/2006 at 12:58 PM

hi all ,

i want to ask how to replace the click event in the menu item with ondblclick event .
should i use fuction instead of href, if so where to put it and wich code i have to change.

thanks.


tigra - 2/14/2006 at 08:59 PM

The code of the script must be modified to use double click. See the place in the code where HTML of the tree is generated.


bird - 2/15/2006 at 07:46 AM

hi.

thanks for reply, i will ask my question again maybe you could help me.
first: i am using the free version using this files:
tree.js , tree_items.js and tree_tpl.js.
i want to change the event click in the tree with the dblclick event so the event click will not work and the dblclick send me to the target (another page)? where should i change?

i know javascript but i search on the tree.js and tryed to change on the code but i could only make changes to the folder (node) and not to the files, so please help.

i will post the code where i tried to change but it didn't work to me:

function item_init () {
var a_offset = [],
o_current_item = this.o_parent;
for (var i = this.n_depth; i > 1; i--) {
a_offset = '<img src="' + this.o_root.a_tpl[o_current_item.is_last() ? 'icon_e' : 'icon_l'] + '" border="0" align="absbottom">';
o_current_item = o_current_item.o_parent;
}
return '<table cellpadding="0" cellspacing="0" border="0"><tr><td nowrap>' + (this.n_depth ? a_offset.join('') + (this.a_children.length
? '<a href="javascript: trees[' + this.o_root.n_id + '].toggle(' + this.n_id + ')" onmouseover="trees[' + this.o_root.n_id +'].mover(' + this.n_id + ')" onmouseout="trees[' + this.o_root.n_id + '].mout(' + this.n_id + ')"><img src="' + this.get_icon(true) + '" border="0" align="absbottom" name="j_img' + this.o_root.n_id + '_' + this.n_id + '"></a>'
: '<img src="' + this.get_icon(true) + '" border="0" align="absbottom">') : '')
+ '<a href="' + this.a_config[1] + '" target="' + this.o_root.a_tpl['target'] + '" onclick="" ondblclick="trees[' +this.o_root.n_id + '].toggle(' + this.n_id + ')" onmouseover="trees[' + this.o_root.n_id + '].mover(' + this.n_id + ')" onmouseout="trees[' + this.o_root.n_id + '].mout(' + this.n_id + ')" class="t' + this.o_root.n_id + 'i" id="i_txt' + this.o_root.n_id + '_' + this.n_id + '"><img src="' + this.get_icon() + '" border="0" align="absbottom" name="i_img' + this.o_root.n_id + '_' + this.n_id + '" class="t' + this.o_root.n_id + 'im">' + this.a_config[0] + '</a></td></tr></table>' + (this.a_children.length ? '<div id="i_div' + this.o_root.n_id + '_' + this.n_id + '" style="display:none"></div>' : '');
}

i tried to change:
<a href="' + this.a_config[1] + '" target="' + this.o_root.a_tpl['target'] + '" onclick="" ondblclick="trees[' + this.o_root.n_id +'].toggle(' + this.n_id + ')" onmouseover="trees[' + this.o_root.n_id + '].mover(' + this.n_id + ')" onmouseout="trees[' +this.o_root.n_id + '].mout(' + this.n_id + ')" class="t' + this.o_root.n_id + 'i" id="i_txt' + this.o_root.n_id + '_' + this.n_id + '"><img src="' + this.get_icon() + '" border="0" align="absbottom" name="i_img' + this.o_root.n_id + '_' + this.n_id + '" class="t' + this.o_root.n_id + 'im">' + this.a_config[0] + '</a></td></tr></table>' + (this.a_children.length ? '<div id="i_div' + this.o_root.n_id + '_' + this.n_id + '" style="display:none"></div>' : '');
didn't work!
is this the place , and what i have to change? please help

thanks a lot.


tigra - 2/16/2006 at 02:42 AM

The code you're looking at is for [+/-] icon, not for the item icon or item text.

You'll need to set onclick="return false" if you don't want browser redirected on the click


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