setOverflowHeight was not working in dynamic loading. Strange things happend during menu display.
I edited the sample for dynamic loading (dynamic_loading.html) just to show as an example.
50 menu.setIconsPath("…/images/");
51 menu.setOverflowHeight(4); /* code inserted by me */
52 menu.enableDynamicLoading("…/common/dhtmlxmenu_dl.php");
I badly need this two to since i have a very huge menus with long subitem.
Thanks in advance…
Right,
For the moment setOverflowHeight is render all loaded items.
Recommended way for usage:
menu.loadXML(“mymenu.xml”, function(){
menu.setOverflowHeight(…);
});
For the dynamical content it will added in future release.
I feel sad that i need to wait for the future release to use this functionality in dynamic loading.
By the way I made a quick fix for myself because I really badly needed this feature.
With that fix, I can now use the setOverflowHeight together with the dynamic loading but not so sure if I made it right.
On dhtmlxmenu.js line 215, I change the code from:
var auId = “arrowup_”+id;
var adId = “arrowdown_”+id;
if (this.idPull[“arrowup_”+id] != null) {
arrowUp = this.idPull[“arrowup_”+id];
arrowUp.style.visibility = “hidden”;
arrowUp.style.display = “”;
arrowUp.style.zIndex = this.zInd;
arrUpH = arrowUp.offsetHeight;
}
if (this.idPull[“arrowdown_”+id] != null) {
arrowDown = this.idPull[“arrowdown_”+id];
arrowDown.style.visibility = “hidden”;
arrowDown.style.display = “”;
arrowDown.style.zIndex = this.zInd;
arrDownH = arrowDown.offsetHeight;
}
TO CODE:
var auId = “arrowup_”+id;
var adId = “arrowdown_”+id;
if (this.idPull[“arrowup_”+id] == null) {
this.addUpArrow(id.replace(this.idPrefix,"")); // Adding the up arrow if none was found
}
arrowUp = this.idPull["arrowup"+id];
arrowUp.style.visibility = “hidden”;
arrowUp.style.display = “”;
arrowUp.style.zIndex = this.zInd;
arrUpH = arrowUp.offsetHeight;
if (this.idPull[“arrowdown_”+id] == null) {
this.addDownArrow (id.replace(this.idPrefix,"")); // Adding the down arrow if none was found
}
arrowDown = this.idPull["arrowdown"+id];
arrowDown.style.visibility = “hidden”;
arrowDown.style.display = “”;
arrowDown.style.zIndex = this.zInd;
arrDownH = arrowDown.offsetHeight;
And implementation will be:
menu.setOverflowHeight(5);
menu.enableDynamicLoading(“xml_menu.php”);
Hopes I have done it right. Works well on me so far.
Thanks,
Tosh