Recent Questions Example With Dhtmlx Tree
Q: I have been evaluating your dhtml-tree product, for a potential use.
It does just about every thing I want apart from 1 thing:
I want each css dropdown menu item to (optionally) support the following syntax:
<a href="menu_link.html" onClick="return fnClickedLinked()">Menu Link</a>
I have worked out how to change the "menu_link.html", and also that it could be something like "javascript:fnClickedLinked()".
However I want the above syntax, where search engines can pick up the link and if my function returns false, the link is not followed when clicked.
Is this possible?
Or can I cancel the link navigation using the tree API node click event??
A: Actually you can add the html code inside item's text:
["|<a href="menu_link.html" onClick="return fnClickedLinked()">Menu Link</a>","", "", "", "", "Tip", "", "", "", "", ],
You can also try to use API function:
function dtreet_ext_userClick (itemID)
http://deluxe-tree.com/functions-info.htmlQ: I am using the GUI, and have read in your literature that you can put the HTML table in the text area of the javascript select menu item.
However, when I do this nothing displays. Can you please let me know where I a supposed to put the HTML info into the gui. I just want this to be able to show when I click the tab.
A: You should paste your content in the <div> .. </div> tags.
<div id="content1" style=" visibility: hidden;" class="tabPage">
<br><br><br>
<p align=center><img src="img/logo_DM.gif" width=262 height=56 alt="Deluxe-Menu.com"></p>
</div>
<div id="content2" style="visibility: hidden;" class="tabPage">
<br><br><br>
<p align=center><img src="img/logo_DT.gif" width=262 height=56 alt="Deluxe-Tree.com"></p>
</div>
<div id="content3" style=" visibility: hidden;" class="tabPage">
<br><br><br>
<p align=center><img src="img/logo_DTabs.gif" width=254 height=58 alt="Deluxe-Tabs.com"></p>
</div>
See in Deluxe Tabs there are two modes:
1. var tabMode=0;
You can create only one level of tabs and assign Object Id's of theDIV's to show when you click on the tab.
["XP Tab 1","content1", "", "", "", "", "", "", "", ],
["XP Tab 2","content2", "", "", "", "", "", "", "", ],
["XP Tab 3","content3", "", "", "", "", "", "", "", ],
["XP Tab 4","content4", "", "", "", "", "", "", "", ],
2. var tabMode=1;
You can assign only links in this mode.
You should create top level items with subitems.
["XP Tab 1","", "", "", "", "", "", "", "", ],
["|Link 1_1","http://deluxe-tabs.com", "", "", "", "", "0", "", "", ],
["|Link 1_2","testlink.htm", "", "", "", "", "0", "", "", ],
["|Link 1_3","testlink.htm", "", "", "", "", "0", "", "", ],
["|Link 1_4","testlink.htm", "", "", "", "", "0", "", "", ],
["|Link 1_5","testlink.htm", "", "", "", "", "0", "", "", ],
["XP Tab 2","", "", "", "", "", "", "", "", ],
["|Link 2_1","testlink.htm", "", "", "", "", "0", "", "", ],
["|Link 2_2","testlink.htm", "", "", "", "", "0", "", "", ],
["|Link 2_3","testlink.htm", "", "", "", "", "0", "", "", ],
["|Link 2_4","testlink.htm", "", "", "", "", "0", "", "", ],
["|Link 2_5","testlink.htm", "", "", "", "", "0", "", "", ],
["XP Tab 3","", "", "", "", "", "", "", "", ],
["|Link 3_1","testlink.htm", "", "", "", "", "0", "", "", ],
["|Link 3_2","testlink.htm", "", "", "", "", "0", "", "", ],
["|Link 3_3","testlink.htm", "", "", "", "", "0", "", "", ],
["|Link 3_4","testlink.htm", "", "", "", "", "0", "", "", ],
["|Link 3_5","testlink.htm", "", "", "", "", "0", "", "", ],
You can use Object ID as well as Link in both modes. Use the following prefixes within item's link field:
"object:" - means that there is object id after it;
"link:" - means that there is a link after it.
"javascript:" - means that there is a javascript code after it, for example:javascript:alert(\'Hello!\')
So, you should write for example:
["|Link 1_1","object:Content1_1", "", "", "", "", "0", "", "", ],
Q: I got it working however I have an additional question.
How do I allocate the width of each "button" see sample how for instance the "FAQ" button is so narrow compared to others. I tried adding spaces with no result.
A: You can use Individual Item Styles to set exact width for the menuitems.
For example:
var itemStyles = [
["itemWidth=100px"], //style 0
];
var menuItems = [
["Home","testlink.html", "", "", "", "", "0", "", "", ], //style 0
["Product Info","", "", "", "", "", "0", "", "", ], //style 0
Q: All dhtml dropdown menu links opens in a new window even when they're configured to open in the same page (or another frame).
A: Check the following dhtml dropdown menu parameters:
var itemTarget="_self";
["menu item","link.htm", "", "","Tip", "_self", "", "", "", "", "", ],