Issue Recurring and Multiple users

When the connector is set to handle users it will work. But when you load the recurring js in the same scheduler the events won’t load into the scheduler and you have the following error when you inspect the code:

TypeError: scheduler.date[“transpose_”+e.rec_pattern] is not a function. (In ‘scheduler.date"transpose_"+e.rec_pattern’, ‘scheduler.date[“transpose_”+e.rec_pattern]’ is undefined)

When you load the recurring js before the dhtmlxscheduler js the items will load but then the lightbox won’t work and you’ve got the following error:

ReferenceError: Can’t find variable: scheduler

Does anyone know how to solve this issue?

Hello,

dhtmlxscheduler.js must be added before other extension files, this is an expected behavior

Hi,

Yes I know, but when you load it afterwards you get the error:
TypeError: scheduler.date[“transpose_” + e.rec_pattern] is not a function. (In ‘scheduler.date[“transpose_” + e.rec_pattern](i, r)’, ‘scheduler.date[“transpose_” + e.rec_pattern]’ is undefined)

And the events won’t load in to the scheduler.

these scripts are loading :

followed by the css.

I’m sorry found the error, it was mine. The base type of the rec_type wasn’t correct.

I use data.aspx file to gather the data for the scheduler. The scheduler is working properly and data is stored properly. Recurring events are also properly stored. But when i refresh the scheduler the regular events does show but the recurring events do not appear. In debug mode i see this error message:

dhtmlxscheduler_recurring.js:463 Uncaught TypeError: scheduler.date[(“transpose_” + e.rec_pattern)] is not a function.

Data.aspx file:

<%@ Page Language=“C#” Inherits=“System.Web.Mvc.ViewPage” ContentType=“text/xml” %>

<% foreach (var myevent in Model) { %>

<start_date>]]></start_date>
<end_date>]]></end_date>
]]>
]]>

        <% if (myevent.rec_type != "" )
            { %>
            <rec_type>  <![CDATA[<%=     Convert.ToInt16(myevent.rec_type) %>]]></rec_type>  <%} %>            
          
         <% if (myevent.event_length != null)
            { %>                                       
        <event_length>  <![CDATA[<%=   Convert.ToInt32(myevent.event_length)  %>]]></event_length>  <%} %>
        
            <% if (myevent.event_pid != null)
            { %>        
        <event_pid>  <![CDATA[<%=    Convert.ToInt32(myevent.event_pid)   %>]]></event_pid>  <%} %>
    </event>
<% } %>

I am really desperate. Please help!

Thanks in advanced.

Hello,

<rec_type> <![CDATA[<%= Convert.ToInt16(myevent.rec_type) %>]]></rec_type> <%} %> why do you convert rec_type to short int? A typical rec_type looks like this ‘week_1____’ - it can’t be converted to number.
Similar issues may be related to event_pid:

<event_pid> <![CDATA[<%= Convert.ToInt32(myevent.event_pid) %>]]></event_pid> <%} %>

event_pid stores an id of parent series, and id is not necessary an integer value.
It would be easier to treat rec_type, event_length and event_pid as strings, i.e. instead of this:

[code]<% if (myevent.rec_type != “” )
{ %>
<rec_type> ]]></rec_type> <%} %>

<% if (myevent.event_length != null)
{ %>
<event_length> ]]></event_length> <%} %>

<% if (myevent.event_pid != null)
{ %>
<event_pid> ]]></event_pid> <%} %>

<% } %>[/code]
have this:

<rec_type> <![CDATA[<%= myevent.rec_type %>]]></rec_type> <%} %> <event_length> <![CDATA[<%= myevent.event_length == null ? "" : myevent.event_length %>]]></event_length> <%} %> <event_pid> <![CDATA[<%= myevent.event_pid == null ? "" : myevent.event_pid %>]]></event_pid> <%} %> </event>
What would be even easier is to switch data loading to JSON.
Client side:

scheduler.load("data.ashx", "json");

Server side:

[code]var data = new SchedulerDataContext();// EF or LinqToSql data context

var viewData = dc.Recurrings.Select(e => new
{
e.id,
e.text,
start_date = String.Format("{0:MM/dd/yyyy HH:mm}", e.start_date),
end_date = String.Format("{0:MM/dd/yyyy HH:mm}", e.end_date),
e.color,
e.rec_type,
e.event_length,
e.event_pid
});

var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

// HttpContext or HttpResponse
context.Response.ContentType = “text/json”;
context.Response.Write(serializer.Serialize(viewData));
[/code]

Hello Aliaksandr.

Thank you for your comment. I really appreciate it. I will modify the code with your suggestions and see if it works.

Aliaksandr hello.

I still get the error:
Uncaught TypeError: scheduler.date [( “transpose_” + e.rec_pattern)] is not a function.

I use the Data.aspx file.

In Internet Explorer, I do not get this error and recurring events do appear and continue to work well. I only get the error in Chrome and Firefox. In both browsers the recurrings events do not appear.

Do you know what causes this error?

Thanks in advance.

Hi,
please show your code after changes you’ve made and server response from Data.aspx that throws an error.
This error usually happen because of invalid values of rec_type in http response, seeing the code and an actual data that client reveices should help locating the issue

Hello Aliaksandr

Thanks you for your reply. I have modified the code in the controller and the index.aspx file. It’s just what i needed. It does the job quite well so far.