search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Custom Event Context Menus on DayPilotMonth

Asked by Simon Edwards
16 years ago.

The BeforeEventRenderEventArgs for the DayPilotMonth doesn't include a <b>ContextMenuClientName</b>.

Is there another way to have different context menus assigned to different events in the DayPilotMonth?

Comment posted by Dan Letecky
16 years ago.
Not yet, but it will be added in the next major version (4.7).
Comment posted by Simon Edwards
16 years ago.

Thanks, that'll help but I'm coming to the conclusion that I'll also need greater flexibility in the waytheresulting 'EventMenuClick' is handled. For example, it's possible to handle other 'Event' Events ;) through Javascript orPostback. But once we've set the EventRightClickHandling to ContextMenu, it seems the resulting click can then only be handled server-side through the passing of a command to the Server-side event.

Unfortunately, one of the things I need to do when the user clicks on one of the context menu options, is to load a page as a 'modal dialog' which I can only seem to do through client-side javascript using openWindow... and can see no way of instagating this from the server-side click event.

At the same time as bringing the DayPilotMonth up-to-date as regards context menu functionality, is it also possible to look at providing both a client-side and server-side option for the handling of the resulting 'click'?

At present, I'm adding 'links' to the Bubble as a way of providing an alternative to right-clicking, so you just hover over the event on the month control, then select 'Properties' (for example), and a modal properties form is displayed - it's not exactly what I want, but at least the bubble rendering allows me to construct a menu inside the bubble which is different for each event too.

Comment posted by Dan Letecky
16 years ago.
Each menu item has a property that determines it's handling. See also the example from Demo/Calendar/Default.aspx:

<daypilot:daypilotmenu id="DayPilotMenu1" runat="server">
<DayPilot:MenuItem Text="Open" Action="JavaScript" JavaScript="alert('Opening event (id {0})');" ></DayPilot:MenuItem>
<DayPilot:MenuItem Text="Send" Action="JavaScript" JavaScript="alert('Sending event (id {0})');" ></DayPilot:MenuItem>
<DayPilot:MenuItem Text="-" Action="NavigateUrl" ></DayPilot:MenuItem>
<DayPilot:MenuItem Text="Delete (CallBack)" Action="Callback" Command="Delete"></DayPilot:MenuItem>
<DayPilot:MenuItem Action="PostBack" Command="Delete" Text="Delete (PostBack)" />
<DayPilot:MenuItem Action="NavigateUrl" NavigateUrl="javascript:alert('Going somewhere else (id {0})');" Text="NavigateUrl test" />
</daypilot:daypilotmenu>

The Action attribute determines how an item will be handled (it can be CallBack, PostBack, JavaScript, and NavigateUrl).

EventMenuClick is executed only if you click on a menu item with Action="CallBack" or Action="PostBack".

Is that what you are looking for?
Comment posted by Simon Edwards
16 years ago.

Yes, exactly that. Thanks.

Comment posted by James Daniel
16 years ago.
We're up to 4.9, and there's still no custom event context menus on daypilotmonth. When can we expect that?
Comment posted by Dan Letecky
16 years ago.
Comment posted by Dan Letecky
16 years ago.
Custom context menu for DPM was implemented in DayPilot Pro 4.9 SP1.
Comment posted by Anonymous
15 years ago.

Yes you can implement a custom ContextMenu for each event rendered.

Here what i did to so. First i use the ComponentArt modal control.

In the event of the DayPilotMonth "_BeforeEventRender" change the "InnerHTML" with something like mine.

e.InnerHTML = "<div style='float:left; padding-left:2px; cursor:hand;' onClick='EventModal();'>" & e.InnerHTML & "</div>"

Now i can use the Modal to do anything i want in server side event.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.