This is a migrated thread and some comments may be shown as answers.

Javascript error when loading appointments

2 Answers 80 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
wayne
Top achievements
Rank 1
wayne asked on 26 Aug 2010, 02:26 AM
Hi, 

I'm trying to use the radScheduler however i'm getting a javascript error whenever i return appointments (via wcf web service) back to the calendar.

In particular, the problem is happening in the radControls script.  (See below)  The problem appears to be because the object G is expected to have attributes called 'Subject', 'Start' ect, however, it only appears to contain them as '_start', '_subject'.

I do not have any idea how to fix this?  

I'm not sure if this is related, BUT i am unable to use the radScriptManager on this page because it wont load the MSAjax js library.  I can however use the normal ScriptManager ?

Any help would be much appreciated!

Edit: In addition, i have tried to implement my own version of IAppointmentData, however i've noticed that the 'description' property is not available to the interface, is this supposed to be the case?

I cant find very much documentation on these calendar components, there appears to be very little (if any) commenting on the help, it just lists the property and method names which is pretty useless.

g's values
__type: "AppointmentData:#Telerik.Web.UI"
    _attributes: {...}
    _description: "rar description"
    _encodedId: "abc"
    _end: Thu Aug 26 12:01:47 UTC+1000 2010
    _id: "abc"
    _recurrenceParentID: null
    _recurrenceRule: null
    _recurrenceState: 0
    _reminders: {...}
    _resources: {...}
    _start: Thu Aug 26 11:01:47 UTC+1000 2010
    _subject: "abc"
    _visible: true

Should this have a proper constructor ?
g.constructor.toString()
"
function Object() {
    [native code]
}
"


_loadAppointment:function(g){var f=new b.SchedulerAppointment();
f._id=g.ID;
f._internalID=g.EncodedID;
f.set_subject(g.Subject);
f.set_description(g.Description);
----->f.set_start(this._toClientDate(g.Start));<----
f.set_end(this._toClientDate(g.End));
f._setOwner(this._owner);
f._recurrenceRule=g.RecurrenceRule;
f._recurrenceParentID=g.RecurrenceParentID;
f._recurrenceState=g.RecurrenceState;
f._visible=g.Visible;
f.set_toolTip(g.Subject);

2 Answers, 1 is accepted

Sort by
0
wayne
Top achievements
Rank 1
answered on 27 Aug 2010, 05:18 AM
Why is there no response?  I have put in support tickets, i have posted here?

In addition to the above, i've noticed that the types for AppointmentData ect have not been registered as ajax javascript types??  Is it not weird that the scheduler control and mini calendars work but not these?  
0
T. Tsonev
Telerik team
answered on 31 Aug 2010, 12:25 PM
Hello Wayne,

Can we see the custom implementation of IAppointmentData? Depending on whether you're using ASP.NET 2.0 and 3.5 you must mark it with either [Serializable] or [DataContract] attribute. Here's how the AppointmentData default implementation looks like:

#if ASPNET35 || ASPNET40
    [DataContract]
#endif
    [Serializable]
    public class AppointmentData : IAppointmentData
    {
 
// ...
 
#if ASPNET35 || ASPNET40
        [DataMember]
#endif
        public virtual DateTime Start
        {
            get { return _start; }
            set { _start = value; }
        }
 
#if ASPNET35 || ASPNET40
        [DataMember]
#endif
        public virtual DateTime End
        {
            get { return _end; }
            set { _end = value; }
        }
 
// ...

We recommend you to inherit AppointmentData instead of implementing the interface from scratch.

I hope this helps.

Kind regards,
Tsvetomir Tsonev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Scheduler
Asked by
wayne
Top achievements
Rank 1
Answers by
wayne
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or