scheduler contextmenu and linux client

Hello,

i use the scheduler and i use a contextmenu in my scheduler. The scheduler with contextmenu works normal with a windows client (pc). But i have a problem with the contextmenu and a linux (open suse) client. The browser on both pcs is firefox 5.0.1.

At first i created a menu as contextmenu:

var menu = new dhtmlXMenuObject();
menu.setIconsPath(’/images/’);
menu.renderAsContextMenu();
var context = ‘<menu id =“dhxContextMenu”>’;
context += ‘<item img=“other.gif” text=“Test” id=“test”>’;
context += ’ ';
menu.loadXMLString(context);

Next i use the event “onContextMenu”:

scheduler.attachEvent(‘onContextMenu’, function (event_id, native_event_object){
menu.setUserData(‘test’,‘event_id’,event_id);
if(event_id) {
var posx = 0;
var posy = 0;
if (native_event_object.pageX || native_event_object.pageY) {
posx = native_event_object.pageX;
posy = native_event_object.pageY;
}
else if (native_event_object.clientX || native_event_object.clientY) {
posx = native_event_object.clientX + document.body.scrollLeft
+ document.documentElement.scrollLeft;
posy = native_event_object.clientY + document.body.scrollTop
+ document.documentElement.scrollTop;
}
menu.showContextMenu(posx-1,posy-1)
}
});

I have no idea why the client with linux does not work.
So i need your help, thanks.

Which version of context menu you are using?
There was a similar issue in dhtmlxMenu 2.5 ( weird menu miss position, because of different font rendering in Linux and Windows )

i use dhtmlxMenu v.2.5 build 91111

i updated only the menu source from 2.5 to 2.6. The other dhtmlx components have the 2.5 source code.
Now every contextmenu, for example in grid or treegrid, the contextmenu is left top of the website :confused:
And in the scheduler i have not a contextmenu. If i click the right mouse button, than the screen is for 1 secound black and i get the contextmenu from firefox.
The new problem is now on windows and linux client.
I tested the menu source code from 3.0, but i have the same problem with version 2.6

Here is an example for grid with contextmenu

// menu
menu = new dhtmlXMenuObject();
menu.setIconsPath("…/common/images/");
menu.renderAsContextMenu();
menu.attachEvent(“onClick”, onButtonClick);
// grid
mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setImagePath("…/…/codebase/imgs/");
mygrid.setHeader(“Test,Test”);
mygrid.setInitWidths(“250,250”);
mygrid.enableAutoWidth(true);
mygrid.setColAlign(“left,left”);
mygrid.setColTypes(“ro,link”);
mygrid.setColSorting(“str,str”);
mygrid.enableContextMenu(menu);
mygrid.init();
mygrid.setSkin(“dhx_skyblue”);

on domready, the grid get data with: mygrid.load(’’);
var context = ‘<menu id =“dhxContextMenu”>’;
context += ‘<item img=“other.gif” text=“Test” id=“test”>’;
context += ’ ';
the menu get the entries in the onMouseOver event with: menu.loadXMLString(context)

I checked the samples dhtmlxGrid->contextmenu and nothing changed to init the contextmenu on grid.

Check the attached sample, it uses latest Scheduler 3.0 and Menu 3.0
1313752791.zip (100 KB)

i checked the sample. The several days events i get a context menu, its ok. But for example the event on 5th august (Happy birthday) i can see for a very short time the context menu and after this i see the firefox context menu. If i created an event on tab day, i have the same problem, first contextmenu and then the firefox contextmenu. I checked the sample with a windows client.

Hello,

Try editing following line:

menu.showContextMenu(mx-2, my-2);

I’ve added -2, -2 for each coordinate, now default menu should not be displayed.

Please check if it solves this issue.

Best regards,
Ilya

i tried the example on a windows client and it works on all events. After this test i copy the example on a linux client with open suse. The test on the linux client was negativ, i don’t get a contextmenu in the example with right mouse click.
But i suss that i get the scheduler contextmenu by the key “ctrl” + scrollwheel.
So i tested the “ctrl” + scrollwheel on my application and it works with the key combination. In my application i used grid, treegrids too. I haven’t problems on grids or treegrids with a contextmenu. In grids and treegrids i get a contextmenu with the right mouse click.

It is not good to use the scheduler with “ctrl” + scrollwheel to get the contextmenu.

So, i hope that i give you a good idea and we find a good solution for this problem.