事件选择被视为事件移动

时间:2015-04-16 08:07:06

标签: scheduler daypilot

我使用daypilot计划程序预订酒店的房间。 我想使用事件多选,但是当我启用此功能时,调度程序将其视为移动事件而非选择

我做了如下

 AllowMultiSelect="true"
 OnEventSelect="MonthScheduler_EventSelect"

编辑:

  <div id="colright" style="margin-left:20px;">
            <div class="row">
                <DayPilot:DayPilotScheduler ID="MonthScheduler"
                    OnEventMenuClick="Scheduler_EventMenuClick"
                    runat="server"
                    RowHeaderWidthAutoFit="true"
                    DataStartField="Start"
                    DataEndField="End"
                    DataTextField="Name"
                    DataValueField="Id"
                    DataResourceField="ressource"
                    HeaderFontSize="9pt"
                    EventHeight="25"
                    EventFontSize="11px"
                    RowHeaderWidth="200"
                    Width="1050"
                    Height="500"
                    HeightSpec="Fixed"
                    ShowToolTip="false"
                    CellDuration="1440"
                    CellGroupBy="Week"
                    TreeEnabled="true"
                    TreeIndent="15"
                    ClientObjectName="dps1"
                    UseEventBoxes="Always"
                    EnableViewState="true"
                    ScrollLabelsVisible="false"
                    BubbleID="DayPilotBubble1"
                    ResourceBubbleID="DayPilotBubble1"
                    DataTagFields="Description"
                    TimeRangeSelectedHandling="PostBack"
                    OnTimeRangeMenuClick="DayPilotScheduler1_TimeRangeMenuClick"
                    OnEventResize="MonthScheduler_EventResize"
                    OnTimeRangeDoubleClick="MonthScheduler_TimeRangeDoubleClick"
                    OnTimeRangeSelected="MonthScheduler_TimeRangeSelected"
                    DragOutAllowed="false"
                    EventResizeHandling="PostBack"
                    EventMoveHandling="PostBack" 
                    OnEventMove="MonthScheduler_EventMove" 
                    xCellBubbleID="DayPilotBubble1"
                    OnBeforeEventRender="MonthScheduler_BeforeEventRender"
                    OnBeforeResHeaderRender="MonthScheduler_BeforeResHeaderRender"
                    OnBeforeTimeHeaderRender="MonthScheduler_EventMove_BeforeTimeHeaderRender"
                    EventMovingStartEndEnabled="true"
                    EventResizingStartEndEnabled="true"
                    OnScroll="MonthScheduler_Scroll"
                    Theme="scheduler_traditional"
                    BorderColor="#666666"

                    OnResourceCollapse="MonthScheduler_ResourceCollapse"
                    TimeRangeSelectingStartEndFormat=""
                    AllowMultiSelect="true"
                    OnEventSelect="MonthScheduler_EventSelect"
               EventClickHandling="Select"
                    ContextMenuSelectionID="DayPilotMenuSelection"
                    TreePreventParentUsage="true"
                    HourNameBackColor="#F0F0F0">
                </DayPilot:DayPilotScheduler>
            </div>
            <DayPilot:DayPilotBubble ID="DayPilotBubble1" runat="server" ClientObjectName="bubble"
                Width="0" OnRenderEventBubble="MonthScheduler_RenderEventBubble"  OnRenderContent="MonthScheduler_RenderContent" 
                Corners="Rounded" Position="Mouse" Animated="false" >
            </DayPilot:DayPilotBubble>
            <DayPilot:DayPilotMenu ID="DayPilotMenu1" CssClassPrefix="menu_default" 
                runat="server" ClientObjectName="DayPilotMenu1" MenuTitle="Action" ShowMenuTitle="true">
                <DayPilot:MenuItem Action="PostBack" Command="Modifier" Text="Edit" />
                <DayPilot:MenuItem Action="PostBack" Command="Delete" Text="Delete" />

            </DayPilot:DayPilotMenu>
            <DayPilot:DayPilotMenu ID="DayPilotMenuSelection" runat="server" ZIndex="10003" MenuTitle="Action" CssClassPrefix="menu_default" >
             <DayPilot:MenuItem Action="PostBack" Command="New" Text="Add new" />
             <DayPilot:MenuItem Action="PostBack" Command="Old" Text="Add old" />
             </DayPilot:DayPilotMenu>
        </div>

这是我的事件选择(在选择时没有触发)

protected void MonthScheduler_EventSelect(object sender, DayPilotEventArgs e)
       {
//do         }

1 个答案:

答案 0 :(得分:0)

您需要将其中一个用户操作映射到&#34;选择&#34;行为。

有两个基本选项:

  1. 点击

    EventClickHandling="Select"
    
  2. 双击

    EventDoubleClickHandling="Select"
    
  3. 另请参阅文档中的event selecting主题。这当然会阻止您将此操作用于其他行为(例如打开编辑对话框)。如果要打开编辑对话框,还可以添加一个特殊的&#34;编辑&#34;图标(使用active areas)。

    即将推出的版本(8.0)也将支持&#34;矩形事件选择&#34;这将允许您使用Shift +拖动选择多个事件,就像在桌面文件管理器应用程序中一样。在这里查看预览:

    http://javascript.daypilot.org/sandbox/scheduler/eventmultiselecting.html