scheduler.setLoadMode("month")

Hi,

I’m using scheduler.setLoadMode(“month”) but navigating back and forth between pages loose some data , disabling cache scheduler.config.prevent_cache = true; seems not working.
Using version dhtmlxScheduler v.4.3.1.
thanks

Hello,

Could you provide with the demo link, where the problem can be reproduced?

Hello,

Below: calendar.asp, calendarTest4.asp.
calendarTest4.asp doesn’t reload when you go back to intervals you already visited (scheduler.config.prevent_cache = true)

calendar.asp:

      <style type="text/css" media="screen">
            html, body{
                margin:0px;
                padding:0px;
                height:100%;
                overflow:hidden;
             }   
      </style>
       
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body>
   <div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
        <div class="dhx_cal_navline">
            <div class="dhx_cal_prev_button">&nbsp;</div>
            <div class="dhx_cal_next_button">&nbsp;</div>
            <div class="dhx_cal_today_button"></div>
            <div class="dhx_cal_date"></div>
            <div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
            <div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
            <div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
        </div>
        <div class="dhx_cal_header"></div>
        <div class="dhx_cal_data"></div>       
    </div> 

   <script type="text/javascript" charset="UTF-8">
       $(function () {
           
           scheduler.locale.labels.timeline_tab = "TimeLine";
           var x_unit_value = 'DAY'.toLowerCase();
           var x_date_value = '%d, %D';

           switch ('DAY') {
               case 'YEAR':
                   x_date_value = '%Y';
                   break;

               case 'MONTH':
                   x_date_value = '%M %Y';
                   break;

               case 'WEEK':
                   x_date_value = '%d, %D, %M';
                   break;

               case 'DAY':
                   x_date_value = '%d, %D';
                   break;

               case 'HOUR':
                   x_date_value = '%h %d, %D';
                   break;
           }

           /* settings per la modalita' timeline */
           scheduler.createTimelineView({
               section_autoheight: false,
               name: "timeline",
               x_unit: x_unit_value,  /* measuring unit of the X-Axis. */
               x_date: x_date_value,  /* date format of the X-Axis */
               x_step: 1,        /* X-Axis step in 'x_unit's */
               x_size: 12,       /* X-Axis length specified as the total number of 'x_step's */
               x_start: 0,       /* X-Axis offset in 'x_unit's */
               x_length: 12,     /* number of 'x_step's that will be scrolled at a time */
               y_unit:           /* sections of the view (titles of Y-Axis) */
					[
						{ key: 11027965, label: 'Abramovic, Roman' }, { key: 900252980, label: 'Area, manager' }, { key: 12483, label: 'Baldi, Calogero2' }, { key: 12849, label: 'Berlucchi, Cinzia' }, { key: 12618, label: 'Bia, Andrea' }, { key: 6995, label: 'Bianchi, Emanuela' }, { key: 12466, label: 'Bianchi, Rocco' }, { key: 11027852, label: 'Bianchino, Spruzzato' }, { key: 12569, label: 'Boss, Amendola' }, { key: 296, label: 'Caretto, Ennio' }, { key: 900252539, label: 'Chirkova, Eugenia' }, { key: 11027812, label: 'DDT, Jake' }, { key: 164, label: 'DEROSSI, BARBARA' }, { key: 12847, label: 'Faustini, Marta' }, { key: 339, label: 'Ferrari, Matteo' }, { key: 12906, label: 'Fiera, Antonello' }, { key: 12893, label: 'Fiera, Marco' }, { key: 11027817, label: 'Folletti, Gianluca' }, { key: 6881, label: 'Giannino, Romolo' }, { key: 11027849, label: 'Gutierrez, Carlos' }, { key: 900251060, label: 'Howlet, James' }, { key: 900251699, label: 'Milani do Prado Rossi, Julia' }, { key: 6879, label: 'Pezzoli, Andrea' }, { key: 12867, label: 'Piepolo, Francesco' }, { key: 12753, label: 'Pietra, Danilo' }, { key: 12833, label: 'Pollame, Pietro' }, { key: 304, label: 'Pomi, Livio' }, { key: 32, label: 'Progra, Luca' }, { key: 12589, label: 'PROVA, PROVAPROVA' }, { key: 6975, label: 'Sinocchi, Marco' }, { key: 12735, label: 'Superga, Sebastiano Franco' }, { key: 11027892, label: 'Valt, Roberto' }, { key: 12471, label: 'Verdi, Domenico' }, { key: 900252503, label: 'Volpe, Alessia' }
					],
               y_property: "timelineConnectorField", /* mapped data property*/
               render: "bar"    /* view mode*/
           });


           scheduler.config.prevent_cache = true;
           scheduler.init('scheduler_here', new Date(2016, 6, 08, 0, 0, 0, 0), "month");               
           scheduler.setLoadMode("month");
           scheduler.load("CalendarTest4.asp", "xml");
           scheduler.setCurrentView(scheduler._date, "timeline");
       });
   </script>

   <!-- 
        select * from PeopleCourse 
        where CourseStart is not null 
        and CourseEnd is not null 
   -->
</body>

calendarTest4.asp

<% Response.ContentType = “text/xml”

'2016-09-01&to=2016-10-01".
from_date = request.QueryString(“from”)
to_date = request.QueryString(“to”)
%>

<% if from_date=“2016-08-01” and to_date=“2016-09-01” then %>

<event_id>TimelineAbsenceRequestDepartmentESS_08</event_id>
<start_date>08/08/2016 09:00:00</start_date>
<end_date>08/26/2016 18:00:00</end_date>
Fiera, Antonello (Accettato)

Accettato



white
blue
12906<event_id>TimelineAbsenceRequestDepartmentESS_09</event_id>
<start_date>08/08/2016 09:00:00</start_date>
<end_date>08/26/2016 18:00:00</end_date>
Fiera, Marco (Accettato)
Accettato



white
blue
12893<event_id>TimelineAbsenceRequestDepartmentESS_010</event_id>
<start_date>08/31/2016 09:00:00</start_date>
<end_date>08/31/2016 18:00:00</end_date>
Gutierrez, Carlos (Accettato)
Accettato



white
blue
11027849<event_id>TimelineAbsenceRequestDepartmentESS_011</event_id>
<start_date>08/08/2016 00:01:00</start_date>
<end_date>08/26/2016 23:59:00</end_date>
Howlet, James (Accettato)
Accettato



white
blue
900251060<event_id>TimelineAbsenceRequestDepartmentESS_012</event_id>
<start_date>08/08/2016 09:00:00</start_date>
<end_date>08/26/2016 18:00:00</end_date>
Piepolo, Francesco (Accettato)
Accettato



white
blue
12867<event_id>TimelineAbsenceRequestDepartmentESS_013</event_id>
<start_date>08/08/2016 09:00:00</start_date>
<end_date>08/26/2016 13:00:00</end_date>
Pollame, Pietro (Accettato)
Accettato



white
blue
12833<event_id>TimelineAbsenceRequestDepartmentESS_014</event_id>
<start_date>08/08/2016 09:00:00</start_date>
<end_date>08/26/2016 18:00:00</end_date>
Pomi, Livio (Accettato)
Accettato



white
blue
304<event_id>TimelineAbsenceRequestDepartmentESS_015</event_id>
<start_date>08/08/2016 09:00:00</start_date>
<end_date>08/26/2016 18:00:00</end_date>
Progra, Luca (Accettato)
Accettato



white
blue
32<event_id>TimelineAbsenceRequestDepartmentESS_016</event_id>
<start_date>08/08/2016 09:00:00</start_date>
<end_date>08/26/2016 18:00:00</end_date>
Superga, Sebastiano Franco (Accettato)
Accettato



white
blue
12735<event_id>TimelineAbsenceRequestDepartmentESS_017</event_id>
<start_date>08/08/2016 10:00:00</start_date>
<end_date>08/26/2016 17:00:00</end_date>
Valt, Roberto (Accettato)
Accettato



white
blue
11027892

<% Elseif from_date=“2016-09-01” And to_date=“2016-10-01” Then %>

<event id="TimelineAbsenceRequestDepartmentESS_07"><event_id>TimelineAbsenceRequestDepartmentESS_07</event_id>
<start_date>09/10/2016 00:01:00</start_date>
<end_date>09/10/2016 23:59:00</end_date>
<text>Progra, Luca (Accettato)</text>
<details>Accettato</details>
<calendarinfofield></calendarinfofield>
<linkfield></linkfield>
<textColor>white</textColor>
<color>blue</color>
<timelineConnectorField>32</timelineConnectorField></event><event id="TimelineAbsenceRequestDepartmentESS_08"><event_id>TimelineAbsenceRequestDepartmentESS_08</event_id>
<start_date>09/05/2016 09:00:00</start_date>
<end_date>09/05/2016 11:00:00</end_date>
<text>Chirkova, Eugenia (Richiesta)</text>
<details>Richiesta</details>
<calendarinfofield></calendarinfofield>
<linkfield></linkfield>
<textColor>white</textColor>
<color>red</color>
<timelineConnectorField>900252539</timelineConnectorField></event><event id="TimelineAbsenceRequestDepartmentESS_09"><event_id>TimelineAbsenceRequestDepartmentESS_09</event_id>
<start_date>09/20/2016 09:00:00</start_date>
<end_date>09/20/2016 18:00:00</end_date>
<text>Chirkova, Eugenia (Richiesta)</text>
<details>Richiesta</details>
<calendarinfofield></calendarinfofield>
<linkfield></linkfield>
<textColor>white</textColor>
<color>red</color>
<timelineConnectorField>900252539</timelineConnectorField></event><event id="TimelineAbsenceRequestDepartmentESS_010"><event_id>TimelineAbsenceRequestDepartmentESS_010</event_id>
<start_date>09/25/2016 00:01:00</start_date>
<end_date>09/25/2016 23:59:00</end_date>
<text>Gutierrez, Carlos (Richiesta)</text>
<details>Richiesta</details>
<calendarinfofield></calendarinfofield>
<linkfield></linkfield>
<textColor>white</textColor>
<color>red</color>
<timelineConnectorField>11027849</timelineConnectorField></event><event id="TimelineAbsenceRequestDepartmentESS_011"><event_id>TimelineAbsenceRequestDepartmentESS_011</event_id>
<start_date>09/10/2016 00:01:00</start_date>
<end_date>09/10/2016 23:59:00</end_date>
<text>Progra, Luca (Richiesta)</text>
<details>Richiesta</details>
<calendarinfofield></calendarinfofield>
<linkfield></linkfield>
<textColor>white</textColor>
<color>red</color>
<timelineConnectorField>32</timelineConnectorField></event>

<%end if %>

Hello,
this is by design, dynamic loading does not reload dates that were already loaded. You can use this code snippet to enforce reloading:

scheduler.attachEvent("onBeforeViewChange", function (old_mode, old_date, mode, date) { if (old_mode != mode || +old_date != +date) scheduler.clearAll(); return true; });