DHTMLX Scheduler with custom timeline week/month views?

4k Views Asked by At

I am using DHTMLX Scheduler, but only for the Timeline view. I want the default by (timeline) day and have buttons for week and month. The initial day is working, but I am having trouble configuring the custom buttons to render my new updates. Fiddle: http://jsfiddle.net/Ld9vZ/19/ For my default day timeline:

// 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");

How do I create a new button

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

to fire a new set of options?

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");
1

There are 1 best solutions below

0
On BEST ANSWER

The tab name as well as the locale property should use the name of the view (in case of the timeline, the name is specified in 'name' property of a config object), e.g. scheduler.locale.labels.mTimeline_tab = "Month Timeline";

Check the snippet: http://docs.dhtmlx.com/scheduler/snippet/e4a91ebe

If you want month timeline to show full month in days, it will require some additional settings of the timeline because of different number of days in months. Here is a working example:

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