Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Carsten Haerle on Sep 22, 2009 09:39
open dhtmlx forum
Open ,menu as contextmenu in dhtmlxgrid and left click on menu button

We use dhtmlxgrid and have a contextmenu (dhtmlxmenu) associated with the dhtmlxgrid (via enableContextMenu). We also want the same menu to open from a menu button positioned above the upper left corner of the dhtmlxgrid. Currently we use a second dhtmlxmenu object configured with setOpenMode("win") which has only an icon but not text associated. Questions:

1) The menu div dhtmlxMenu_dhx_blue_TopLevel_Item_Normal has a padding-left: 27pt hard coded on the generated text, so it is not easily possible to have just the menu icons without a text. As a workaround we used some style "hacking", but were are not completely satisfied with the solution:

div.dhtmlxMenu_dhx_blue_TopLevel_Item_Normal {
    margin-left: -27px;

div.dhtmlxMenu_dhx_blue_TopLevel_Item_Selected {
    margin-left: -27px;
    }

div.dhtmlxMenu_dhx_blue_SubLevelArea_Polygon_left {
    position: absolute;
    background-color: white;
    border-top: #C2D5DC 1px solid;
    overflow: hidden;
}

2) Because we now have to menu objects, also both can be opened. One with the left lick on the menu icon, one with the right click on the dhtmlxgrid and the user can end up with two menu objects opened simulaneously.

Ideally we only want to have one menu object which we can set as the contextmenu of the dhthmlxgrid, so it opens on right click and also associated it to our menu icon.

Is there any possibilty to do that? Do you have a suggestion how to prevent both menus to open at the same time? Could the styles be simpllified (remove the hard coded styles)?

Answer posted by Support on Sep 28, 2009 06:01
Could you please provide completed demo?

Completed demo information here:
http://www.dhtmlx.com/docs/support/what_is_a_completed_demo.htm

You can send it directly to support@dhtmlx.com