0

我正在使用 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         }
4

1 回答 1

0

您需要将用户操作之一映射到“选择”行为。

有两个基本选项:

  1. 点击

    EventClickHandling="Select"
    
  2. 双击

    EventDoubleClickHandling="Select"
    

另请参阅文档中的事件选择主题。这当然会阻止您将此操作用于其他行为(例如打开编辑对话框)。如果您想打开编辑对话框,您还可以添加一个特殊的“编辑”图标(使用活动区域)。

即将推出的版本 (8.0) 还将支持“矩形事件选择”,让您可以使用 Shift + 拖动选择多个事件,就像在桌面文件管理器应用程序中一样。在此处查看预览:

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

于 2015-04-16T09:25:36.610 回答