i want to display different context menus based on the selected activity type in web month view. using left click this functionality can be acheived. problem is that right click on web month view date does not fire the Click (client side event) of Web month view. Is there any way to do this?
<ig_sched:WebMonthView ID="ctlWebMonthView" runat="server" Width="100%" WebScheduleInfoID="WebScheduleInfo1"
Height="460px" WeekendDisplayFormat="Full" AppointmentFormatString="<SUBJECT> (<LOCATION>)"
AppointmentTooltipFormatString="<SUBJECT> (<LOCATION>)" EnableAutoActivityDialog="False"
NavigationButtonsVisible="False" CaptionHeaderVisible="False" DayOfWeekHeaderFormat="Full"
BorderStyle="solid" BorderWidth="1px" BorderColor="Black" >
<AppointmentStyle BorderStyle="Solid" BorderWidth="1px" Font-Size="8pt">
</AppointmentStyle>
<AllDayEventStyle BorderStyle="Solid" BorderWidth="1px" Font-Size="8pt" >
</AllDayEventStyle >
<ClientEvents Click ="DateClicked" /> -- This Click event does not fire on Right Click
</ig_sched:WebMonthView>
Thanx for ur Help!!
Shaheen
You can try the MouseUp and/or MouseDown events and detect if the right button is clicked. According to docs
MouseDownThis event fires when a mouse down occurs on any element in the MonthView.Parameters - oWebMonthView - The WebMonthView client-side object.oEvent - The event object, which allows you to cancel the event, cancel the postback, or request a postbackelement -The html element that corresponds to where the mouse button was pressed down.
You can use oEvent and check if the mouse right click button was clicked using:
var rightcClick = (oEvent.button == 2);
Hey Rumen thanx for the reply. i have tried it with MouseDown Event. It works fine but the problem is that i have to display a context menu based upon the selectedactivity in WebMonthView.
igmenu_showMenu("contextmenu1" oEvent.event); function does not show up any context menu incase of MouseDown or MouseUp events. It only shows menu when Click event is fired. is there any way to solve this issue.
alert((oEvent.event.button == 2)); it gives me false incase of click event, because it gives me 0 value instead of 1 or 2 or 4.
Thanx for ur help!!
Shaheen Tariq
I just tried the following setup and things worked fine for me (context menu shown correct upon clicking right mouse button). I am using the latest 7.3 HotFix. Please, find my sample approach below:
<body oncontextmenu="return false;"> <form id="form1" runat="server"> <script language="javascript"> function mouseDownHandler(scheduler, oEvent, element) { e = oEvent.event; if (e.button == 2) { igmenu_showMenu("<%= CopyPasteMenu.ClientID %>", null, (e.clientX+document.documentElement.scrollLeft)+"px", (e.clientY+document.documentElement.scrollTop)+"px"); //Firefox (W3C) - cancel event if(typeof(e.preventDefault)=="function") e.preventDefault(); //InternetExplorer (Proprietary) - cancel event e.returnValue=false; return false; } } </script> <ig_sched:WebMonthView ID="WebMonthView1" runat="server" WebScheduleInfoID="WebScheduleInfo1"> <ClientEvents MouseDown="mouseDownHandler" /> </ig_sched:WebMonthView> <ig_sched:WebScheduleInfo ID="WebScheduleInfo1" runat="server"> </ig_sched:WebScheduleInfo> <ignav:UltraWebMenu TopAligment="left" TopItemSpacing="Compact" ID="CopyPasteMenu" runat="server" WebMenuStyle="XPClient" WebMenuTarget="PopupMenu" CssClass="ContextMenu" EnableViewState="False"> <Items> <ignav:Item Text="Cut"> <Images><DefaultImage Url="../../styles/office2007black/webhtmleditor/cut.gif" AlternateText="Cut" /> </Images> </ignav:Item> <ignav:Item Text="Copy"> <Images><DefaultImage Url="../../styles/office2007black/webhtmleditor/copy.gif" AlternateText="copy" /> </Images> </ignav:Item> <ignav:Item Text="Paste"> <Images> <DefaultImage Url="../../styles/office2007black/webhtmleditor/paste.gif" AlternateText="paste" /> </Images> </ignav:Item> <ignav:Item Separator="true" > </ignav:Item> <ignav:Item Text="Export To Excel"> <Images> <DefaultImage Url="./excelicon.gif" AlternateText="Export To Excel" /> </Images> </ignav:Item> </Items> <ItemStyle CssClass="ContextMenuItem" /> <HoverItemStyle CssClass="ContextMenuItemHover" /> <ExpandEffects ShadowColor="LightGray" /> </ignav:UltraWebMenu> </form></body>
Well thanx for being so helpful. What i've sorted out i think so problem is with "igmenu_showMenu" , it responds only to the click event neither MouseDOWN nor any other event. Do u have any suggestions in this?
Well, the only difference I see is in the versions we are trying with... I am using 2007.3 latest hotfix, so I guess if there was a problem with this approach it was addressed in latest release.
Is upgrading to 2007.3 applicable in your scenario? Or at least, can you try with the trial version of 2007.3 latest hotfix to verify if it's working correctly in your case or the problem is somewhere else?
Hey Rumen,
Thanx for ur generous help. I've tried the sample code u provided above, but the same problem. It works fine to the if statement but did not show up any context menu although the id of context menu is correct.
I'm using Infragistics NetAdvantage 2006 Vol.3 CLR 2.x with HotFix 1059
<script language="javascript"> function mouseDownHandler(scheduler, oEvent, element) { e = oEvent.event; if (e.button == 2) { igmenu_showMenu("<%= CopyPasteMenu.ClientID %>", null, (e.clientX+document.documentElement.scrollLeft)+"px", (e.clientY+document.documentElement.scrollTop)+"px"); //Firefox (W3C) - cancel event if(typeof(e.preventDefault)=="function") e.preventDefault(); //InternetExplorer (Proprietary) - cancel event e.returnValue=false; return false; } } </script>
Best Regards,