0

我的网站上有一个同步融合调度程序,每当用户添加新约会时,我都需要进行跟踪。跟踪必须在 jquery 中。因此,当创建syncfusion约会并保存约会时,它会将我带到我的控制器。但我无法跟踪它有没有人知道在约会保存时调用 jquery 的方法

      @using Syncfusion.Mvc.Shared
   @using Syncfusion.Mvc.Schedule
@using Combres.Mvc
@{
ViewBag.Title = "Calendar";
Layout = "~/Views/Shared/_LayoutSingleColumn.cshtml";
}
@section scripts {
@Html.CombresLink("syncfusionJs")
@{Html.Syncfusion().ScriptManager().DisableScripts(true).Render();}
<script type="text/javascript">
    $(document).ready(function () {
        $('#User').change(function () {
            location.href = '/Team/Calendar/Index/' + $(this).val();
        });
    });
</script>
<script type ="text/javascript">
    mixpanel.track("View Manager | Calendar");
</script>
}
@section styles {
@Html.CombresLink("syncfusionCss")
<style type="text/css">
    .AppointmentTextBox{ width: 75px; }
    #RecurrenceWindowschedule1 {height: 375px !important;}
</style>
}
<label>User: </label>@Html.DropDownList("User", OpenRoad.Web.Helpers.DropDownLists.GetOptionValues("CalendarUsers", ViewData["UserId"].ToString(), true))<br />
@{Html.Syncfusion().Schedule("schedule1", "ScheduleModel")
.DataSource((System.Collections.IEnumerable)ViewData["data"])
.Resources((List<ScheduleResource>)ViewData["resources"])
.AllowEdit(true)
.AllowAddNew(true)
.AllowDelete(true)
.AllowInline(true)
.AllowDragAndDrop(true)
.AllowMultipleResource(true)
.AllowResize(true)
.AllowPriority(true)
.AllowRecurrence(true)
.AllowReminder(false)
//.ShowResourceHeader(true)
.ShowNavigationPane(true)
.Width(1050)
.Height(640)
.HighlightBusinessHours(true)
//.ShowToolTip(true)
//.ShowImport(true)
//.ShowExport(true)
.Skins(ScheduleSkins.Marble)
.CurrentView(ScheduleViewMode.Month)
.CustomCss("schedule_Custom")    
.BindList(columns =>
{
    columns.IdField("AppointmentId");
    columns.SubjectField("Subject");
    columns.LocationField("Location");
    columns.StartTimeField("StartTimeUtc");
    columns.EndTimeField("EndTimeUtc");
    columns.DescriptionField("Description");
    columns.OwnerField("UserId");
    columns.PriorityField("Priority");
    columns.ReminderField("Reminder");
    columns.RecurrenceField("Recurrence");
    columns.RecurrenceTypeField("Frequency");
    columns.RecurrenceTypeCountField("Interval");
    columns.RecurrenceStartField("RecurrenceStart");
    columns.RecurrenceEndField("RecurrenceEnd");
})
.Render();
}
4

1 回答 1

0

在创建 Syncfusion 约会时,ajaxBegin应该ajaxSuccess调用事件。所以我们可以使用以下事件跟踪创建:

1) ClientSideOnActionBegin("ajaxBegin")
2) ClientSideOnActionSuccess("ajaxSuccess")

试试这样:

@{Html.Syncfusion().Schedule("schedule1", "ScheduleModel")
...
            .ClientSideOnActionBegin("ajaxBegin")
            .ClientSideOnActionSuccess("ajaxSuccess")   
...
.Render();
}

脚本:

<script type="text/javascript">
    // sender => Schedule control's object
    // args => arguments of Ajax request details
    function ajaxBegin(sender, args) {
        var action=args._data.CurrentAction; // we get current action as "Save" on adding new appointment
    }

    // sender => Schedule control's object
    // args => arguments of Ajax request success details
    function ajaxSuccess(sender, args) {
        ...
    }
</script>
于 2013-07-25T09:00:11.673 回答