Timeline view Previous/Next button click events

Hi Team,

I would like to add timeline view(which is similar to week view, beacause we want week view with grouping feature), to already implemented scheduler (which has Day, Week, Month & Year Views).

As scheduler.load(url,‘json’) is unbale to load the data for Time line view, we are using scheduler.parse() method.

Below is the code sample:

           var currentTime = new Date(); 

            scheduler.locale.labels.day_line_tab = "TimeLine";
            scheduler.createTimelineView({
                 name:      "time_line",
                 x_unit:    "day",
                 x_date:    "%d %M",
                 x_step:    1,
                 x_size:    7,
                 //x_start:   currentTime.getDay(),
                 x_length:  7,
                 y_unit:
                    [   {key:20, label:"Events"},
                        {key:10, label:"Projects"},
                        {key:30, label:"Categories"},
                        {key:40, label:"Jobs"}  ],
                 y_property:"section_id",
                 render:    "bar"
            });

            var mode1 = scheduler.getState().mode;
             if(mode1 == "time_line")
             {
            var url = ['@Url.Action](mailto:'@Url.Action)("load")';
            var arg = null;
            var start = getMonthStart(currentTime);
            var end = getMonthEnd(currentTime);
            arg = "?id=" + viewID +"&timeshift=0&from="+start+"&to="+end;
            url = url + arg;
            var data = [];
             $.ajax({
                type: 'GET',
                url: url,
                dataType: "json",
                success: function (evt) {debugger
                var innertext='[';
                for(var i=0;i<evt.length;i++)
                {
                     data.push({
                         start_date:evt[i].start_date,
                         end_date:evt[i].end_date,
                         text:evt[i].text,
                         section_id:evt[i].type
                      });
                }
                  
            
            scheduler.parse(data,"json");
                }
            });

            }
            else
            {
             scheduler.load(url, 'json');
            }

The data is loading perfect for the first time to the time line view, but if we click on next arrow, the data for the new week is not being displayed/fetched. where in month(&other) view, when we click on next button the data is being fetched from controller(Load action) on every next/previous button click.

Can you please let us know, are there any predefined button click events for these buttons? or do we need to handle it from inline scripting?

Thanks.

Hi,

Can you clarify what are the issues with built in ajax loading? Usually built in ajax loading works correctly.
Regarding the next/prev buttons, as well as changing of displayed view, you can listen one of these API events:

docs.dhtmlx.com/scheduler/api__s … event.html
docs.dhtmlx.com/scheduler/api__s … event.html