【问题标题】:DHTMLX Scheduler with custom timeline week/month views?具有自定义时间线周/月视图的 DHTMLX 调度程序?
【发布时间】:2015-02-20 17:56:27
【问题描述】:

我正在使用 DHTMLX 调度程序,但仅用于时间线视图。我想要(时间线)日期的默认值,并有星期和月份的按钮。最初的一天工作,但我无法配置自定义按钮来呈现我的新更新。小提琴:http://jsfiddle.net/Ld9vZ/19/ 对于我的默认日期时间线:

// schedule visual settings
        scheduler.createTimelineView({
            name: "timeline",

            // x axis counting by minutes (minute, hour, day, week, month, year)
            x_unit: "minute",

            // 12 hour time format
            x_date: "%h:%i",

            // every 30 minutes
            x_step: 30,

            // lower the number, the wider the columns
            x_size: 24,

            // start at this time, 7:00 am
            x_start: 14,

            // doesn't seem to change
            x_length: 48,

            // y axis names
            y_unit: sections,
            y_property: "section_id",

            // render time as blue bar (bar, tree or cell)
            render: "bar"
        });

// default view is timeline format
        scheduler.init('scheduler_here', new Date(year1, month1, day1), "timeline");

如何创建新按钮

<div class="dhx_cal_tab" name="m_tab" style="right:280px;"></div>
scheduler.locale.labels.m_tab = "Month Timeline"

触发一组新选项?

scheduler.createTimelineView({
                name: "mTimeline",
                x_unit: "month",
                x_date: "%h:%i",
                x_step: 1,
                x_size: 24,
                x_start: 14,
                y_unit: sections,
                y_property: "section_id",
                render: "bar"
            });

// month timeline
        scheduler.config.m_tab('scheduler_here', new Date(year1, month1, day1), "mTimeline");

【问题讨论】:

    标签: javascript jquery plugins dhtmlx dhtmlx-scheduler


    【解决方案1】:

    选项卡名称和区域设置属性应该使用视图的名称(在时间轴的情况下,名称在配置对象的“名称”属性中指定),例如 scheduler.locale.labels.mTimeline_tab = "月份时间线";

    查看sn-p:http://docs.dhtmlx.com/scheduler/snippet/e4a91ebe

    如果您希望月份时间线以天为单位显示整月,则需要对时间线进行一些额外的设置,因为月份中的天数不同。这是一个工作示例:

    http://docs.dhtmlx.com/scheduler/snippet/3acdb725

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-23
      • 2020-03-29
      • 2019-08-13
      • 2020-03-27
      • 2014-03-21
      • 2019-10-24
      • 2016-08-20
      • 2017-01-07
      相关资源
      最近更新 更多