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

Event client object - Custom properties

Asked by giamix
16 years ago.

Hi everybody.. I need to implement the right click behaviour when left clicking on an event. The problem is that i use different context menus according to some custom data of the event. Is there any way to pass some custom dataon an event ? Will you provide in some version any client event object property to be able to pass a custom value?

Comment posted by Dan Letecky
16 years ago.
The best way to do this would be the following:

1. Create several context menu controls (one for each type of the event) .
2. Set EventClickHandling to JavaScript
3. In EventClickJavaScript, invoke the context menu you need based on the value stored in one of the tag fields (see DataTagFields property).

Example:

.ASPX
<DayPilot:DayPilotCalendar ...
EventClickHandling="JavaScript"
EventClickJavaScript="showContextMenu(e);"
DataTagFields="eventtype"
/>

<DayPilot:DayPilotMenu ...
ClientObjectName="contextMenuLunch"
/>

<DayPilot:DayPilotMenu ...
ClientObjectName="contextMenuMeeting"
/>

<script type="text/javascript">
function showContextMenu(e) {
switch (e.tag("eventtype")) {
case "meeting":
contextMenuMeeting.show(e);
break;
case "lunch":
contextMenuLunch.show(e);
break;
}
}
</script>

Comment posted by giamix
16 years ago.

Thanks foryour immediate response!!

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