Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Matteo on Oct 12, 2009 10:49
open dhtmlx forum
scheduler and dhtmlxmenu

Hi,
how can I use dhtmlxMenu on the scheduler ?
I'll try to call showContextMenu(x,y) on scheduler onclick event but it isn't work...

Thanks in advance
Cheers
Matteo
Answer posted by Alex (support) on Oct 13, 2009 02:01

Hello,

you can try to use menu.contextAutoHide = false:

menu = new dhtmlXMenuObject();
menu.renderAsContextMenu();
menu.contextAutoHide = false
menu.loadXML("...");
scheduler.attachEvent("onClick", function (event_id, e){
  menu.showContextMenu(e.clientX,e.clientY)
});

Answer posted by Matteo on Oct 13, 2009 03:36
Thanks for your answer.
But now the menu not showing properly (see the attachment).
Have you got any idea ?

Cheers
Matteo

P.S. : I'm using the code below

<script src="../../codebase/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="../../codebase/dhtmlxscheduler.css" type="text/css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="../../codebase/dhtmlxmenu_dhx_blue.css" type="text/css" media="screen" title="no title" charset="utf-8">   
<script src="../../codebase/dhtmlxmenu.js" type="text/javascript" charset="utf-8"></script>
<script src="../../codebase//ext/dhtmlxmenu_ext.js" type="text/javascript" charset="utf-8"></script>
   
<style type="text/css" media="screen">
    html, body{
        margin:0px;
        padding:0px;
        height:100%;
        overflow:hidden;
    }   
</style>
<script type="text/javascript" charset="utf-8">
    function init() {
       
        scheduler.config.xml_date="%Y-%m-%d %H:%i";
        scheduler.init('scheduler_here',null,"week");
        scheduler.load("../common/events.xml");
       
        scheduler.attachEvent("onClick", function (event_id, e){
            menu1.showContextMenu(e.clientX,e.clientY);
            return false;
           
        });       
       
        var menu1;
        menu1 = new dhtmlXMenuObject(null,"standard");
        menu1.renderAsContextMenu();
        menu1.contextAutoHide = false;               
        menu1.setIconsPath("");
        menu1.addNewChild(menu1.topId, 0, "open", "Open", false, "open.gif");
        menu1.addNewChild(menu1.topId, 1, "save", "Save", false, "save.gif");
        menu1.addNewChild(menu1.topId, 3, "close", "Close", false, "close.gif");
       
    }
</script>

<body onload="init();">
    <div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
        <div class="dhx_cal_navline">
            <div class="dhx_cal_prev_button">&nbsp;</div>
            <div class="dhx_cal_next_button">&nbsp;</div>
            <div class="dhx_cal_today_button"></div>
            <div class="dhx_cal_date"></div>
            <div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
            <div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
            <div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
        </div>
        <div class="dhx_cal_header">
        </div>
        <div class="dhx_cal_data">
        </div>       
    </div>
</body>
Attachments (1)
Answer posted by Alex (support) on Oct 13, 2009 08:34

You set standard skin, but include css file for dhx_blue. 

Try to use menu1 = new dhtmlXMenuObject(null,"dhx_blue") and issue will be solved

Answer posted by Matteo on Oct 13, 2009 09:00
Ops....
Yes, now it works.
Thank you very much
Matteo