Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jupi on Jan 05, 2009 08:50
open dhtmlx forum
Image in DhtmlxMenu Sub Menu

I have a sample code which uses dhtmlxmenu and i am not able to remove the image near the Custom Actions sub menu.

===============================================================================
Code to Reproduce
===============================================================================

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
    <title>Sample DHTMLXMENU</title>
    <link rel="STYLESHEET" type="text/css" href="dhtmlxmenu.css">
    <link rel="STYLESHEET" type="text/css" href="dhtmlxmenu_alter.css">
    
    <script language="JavaScript" src="dhtmlxprotobar.js"></script>
    <script language="JavaScript" src="dhtmlxmenubar.js"></script>
    <script language="JavaScript" src="dhtmlxcommon.js"></script>

        <script>

         var flag;
        var dispSubMenuFlag=false;
        function onButtonClick(itemId,itemValue)
        {
            //do nothing    
        }
        
        function showmenu() {

     if(!flag){

            hideFlag=false;
            aMenuBar=new dhtmlXMenuBarObject(document.getElementById('altermenu'),"10","10","");
            aMenuBar.setOnClickHandler(onButtonClick);
            aMenuBar.setMenuMode("popup");
            aMenuBar.enableWindowOpenMode(false);
            aMenuBar.disableSmartPositioning(true);


            //create menu item
            var item = new dhtmlXMenuItemObject("MainSpan","Span Actions","");
            aMenuBar.addItem(aMenuBar,item);
            //create submenu
            var subMenu1 = new dhtmlXMenuBarPanelObject(aMenuBar,item,false,10,true);
            
         var item = new dhtmlXMenuItemObject("span1","Span Actions 1");        
            aMenuBar.addItem(subMenu1,item);                        
            var item = new dhtmlXMenuItemObject("span2","Span Actions 2","");
            aMenuBar.addItem(subMenu1,item);                

            //create menu item
            var item = new dhtmlXMenuItemObject("MainNote","Notifications","");
            aMenuBar.addItem(aMenuBar,item);
            //create submenu
            var subMenu2 = new dhtmlXMenuBarPanelObject(aMenuBar,item,false,10,true);                
            
            var item = new dhtmlXMenuItemObject("note1","Notifications 1","");        
            aMenuBar.addItem(subMenu2,item);                        
            var item = new dhtmlXMenuItemObject("note2","Notifications 2","");
            aMenuBar.addItem(subMenu2,item);                
            
            //create menu item
            var item = new dhtmlXMenuItemObject("MainCustom","Custom Actions","");
            aMenuBar.addItem(aMenuBar,item);
            //create submenu
            var subMenu3 = new dhtmlXMenuBarPanelObject(aMenuBar,item,false,10,true);                
            
            var item = new dhtmlXMenuItemObject("custom1","Custom Actions 1","");        
            aMenuBar.addItem(subMenu3,item);                        
            var item = new dhtmlXMenuItemObject("custom2","Custom Actions 2","");        
            aMenuBar.addItem(subMenu3,item);        
            var item = new dhtmlXMenuItemObject("custom3","Custom Actions 3","");        
            aMenuBar.addItem(subMenu3,item);        

            //create sub-sub-menu for Custom Actions
            var subMenu4 = new dhtmlXMenuBarPanelObject(subMenu3,item,false,10,true);        

            var item = new dhtmlXMenuItemObject("subcustom1","Sub Custom Actions 1","");        
            aMenuBar.addItem(subMenu4,item);                        
            var item = new dhtmlXMenuItemObject("subcustom2","Sub Custom Actions 2","");        
            aMenuBar.addItem(subMenu4,item);        
            var item = new dhtmlXMenuItemObject("subcustom3","Sub Custom Actions 3","");        
            aMenuBar.addItem(subMenu4,item);    

            aMenuBar.showBar();

            flag = true;

            //setting events for aMenuBar

            var glob_timer;
            dhtmlxEvent(aMenuBar.topNod,_isIE?"mouseleave":"mouseout",function(){
                glob_timer=setTimeout("hide(aMenuBar)",500);

            });

            dhtmlxEvent(aMenuBar.topNod,"mouseover",function(){
             window.clearTimeout(glob_timer);
            });
        

        //setting events for submenu1

             var glob_sub_timer1;
             dhtmlxEvent(subMenu1.topNod,_isIE?"mouseleave":"mouseout",function(){
             dispSubMenuFlag=false;
             glob_sub_timer1=setTimeout("hide(aMenuBar)",500);
             });

         dhtmlxEvent(subMenu1.topNod,"mouseover",function(){
         window.clearTimeout(glob_sub_timer1);
             dispSubMenuFlag=true;
     });


//setting events for submenu2

             var glob_sub_timer2;
             dhtmlxEvent(subMenu2.topNod,_isIE?"mouseleave":"mouseout",function(){
             dispSubMenuFlag=false;
             glob_sub_timer2=setTimeout("hide(aMenuBar)",500);
             });

         dhtmlxEvent(subMenu2.topNod,"mouseover",function(){
         window.clearTimeout(glob_sub_timer2);
             dispSubMenuFlag=true;
     });

//setting events for submenu3

             var glob_sub_timer3;
             dhtmlxEvent(subMenu3.topNod,_isIE?"mouseleave":"mouseout",function(){
             dispSubMenuFlag=false;
             glob_sub_timer3=setTimeout("hide(aMenuBar)",500);
             });

         dhtmlxEvent(subMenu3.topNod,"mouseover",function(){
         window.clearTimeout(glob_sub_timer3);
             dispSubMenuFlag=true;
     });

//setting events for submenu4

             var glob_sub_timer4;
             dhtmlxEvent(subMenu4.topNod,_isIE?"mouseleave":"mouseout",function(){
             dispSubMenuFlag=false;
             glob_sub_timer4=setTimeout("hide(aMenuBar)",500);
             });

         dhtmlxEvent(subMenu4.topNod,"mouseover",function(){
         window.clearTimeout(glob_sub_timer4);
             dispSubMenuFlag=true;
     });


}
}            

        function hide(aMenuBar) {
         if(!dispSubMenuFlag){
                aMenuBar.hideBar();
            }
            flag=false;
        }

    </script>
</head>

<body>

<input type="button" onclick="javascript:showmenu();" id="toolbarbutton" value ="DISPLAY REGULAR MENU" name="toolbarbutton">
<div id="altermenu" style="position:absolute;z-index:1;display:inline;top:30px;left:10px;"></div>
</div>
<br><br>
<table border><tr><td>ROW 1</td></tr><tr><td>ROW 2</td></tr><tr><td>ROW 3</td></tr><tr><td>ROW 4</td></tr></table>
</body>
</html>
Answer posted by Support on Jan 10, 2009 08:57
Do you mean a sub-menu marker ?
This image can't be removed through API, but you can add next code line before menu building code, to remove all such markers from menu

dhtmlXMenuItemObject.prototype.setHasChild=function(){};
Answer posted by Jupi on Jan 12, 2009 07:05
Thank you very much. It works.