MVC3 中的 DHTMLX 定期事件



我在MVC3项目中使用了DHTMLX调度程序。我需要使用定期事件调度程序。除数据库外,所有配置似乎都很好。我需要知道我需要在服务器上为重复发生的事件包含哪些必要字段。

以及重复事件的xml配置和数据检索如何。在该示例中,教程包含服务器端代码,如 php 所示。所以我无法知道如何为 MVC 环境编写代码。请指导我如何做到这一点。

指数

function init() {
    scheduler.templates.event_text = function (start, end, ev) {
        return 'Event: ' + ev.Description + '';
    };
    scheduler.templates.calendar_month = scheduler.date.date_to_str("%F %Y");
    scheduler.config.full_day = true;
    scheduler.locale.labels.full_day = "Full day";
    //week label of calendar
    scheduler.templates.calendar_scale_date = scheduler.date.date_to_str("%D");
    //date value on the event's details form
    scheduler.templates.calendar_time = scheduler.date.date_to_str("%d-%m-%Y");
    scheduler.config.repeat_date = "%m-%d-%Y";
    scheduler.config.update_render = "true";
    scheduler.locale.labels.section_category = 'Category';
    scheduler.locale.labels.section_location = 'Title';
    scheduler.config.lightbox.sections = [
    { name: "location", height: 15, map_to: "title", type: "textarea" },
{ name: "description", height: 50, map_to: "text", type: "textarea", focus: true },
    { name: "recurring", height: 115, type: "recurring", map_to: "rec_type", button:  "recurring" },
{ name: "time", height: 72, type: "time", map_to: "auto" },
    { name: "category", height: 22, type: "select", map_to: "category", options: [
    {key:"", label:"Select Category"},
    {key:"A", label:"Public"},
    {key:"P", label:"Private"},
    {key:"C", label:"Closed"}
           ]}
            ]

           scheduler.config.xml_date = "%m/%d/%Y %H:%i";
           scheduler.init("scheduler_here", new Date(), "month");
           scheduler.load("/Admin/EventCalendar/Dat");
           var dp = new dataProcessor("/Admin/EventCalendar/Save");
           dp.init(scheduler);
           dp.setTransactionMode("POST", false);
           }

谢谢。

您需要在数据库中为相关记录定义 4 字段

  • rec_type,将week_1___6(每周,星期日)
  • start_date - 首次发生日期
  • end_date - 最后发生日期(如果事件没有结束日期,则将其设置为 9999 年)
  • event_length - 事件长度(以秒为单位),在您的情况下为 36600