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

Client-side getAttributes() doesn't have all attributes

4 Answers 191 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
laura
Top achievements
Rank 1
laura asked on 28 Jul 2009, 04:36 PM
I am trying to access certain attributes of an appointment from the client side "onAppointmentEditing" event.  I'm using eventArgs.get_appointment().get_attributes().getAttribute("Type") and it is returning "undefined".  I saw a similar post here:


I'm confused about why the attribute name "Type" wouldn't work.  While debugging my javascript method, I was able to see that the get_attributes() method only has 10 items in it when I actually have 15 custom attributes on my scheduler.  The following custom attributes were missing from the get_attributes()._keys list:

  • "Calendar"
  • "EventTypeID"
  • "Description"
  • "Location"
  • "Type"

All of these are listed in the "CustomAttributeNames" field of my scheduler control.  Are these reserved words in the scheduler control?  Why can't I access them from the client side?

Thank you,
Laura

4 Answers, 1 is accepted

Sort by
0
laura
Top achievements
Rank 1
answered on 29 Jul 2009, 08:41 PM
I have since added two more attributes to my event - AllowEdit and ID.  Only AllowEdit shows up in the client side getAttributes() method.  Any information on this yet?

Thanks,
Laura
0
Accepted
Peter
Telerik team
answered on 30 Jul 2009, 11:55 AM
Hello laura,

Yes, your assumption is correct. There are reserved words which you cannot use for custom attribute names. These are all the appoinment properties and any resource names specified. For example, you cannot use "Subject" or "ID". If you have a resource name called "Type", then you cannot use that for a custom attribute name either.

Try renaming your custom attribute names by adding a prefix to them. For exmaple: Type -> AttrType. Let us know if this helps or not.


Greetings,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
laura
Top achievements
Rank 1
answered on 30 Jul 2009, 01:01 PM
Hi Peter,

Thanks for your reply.  I guess I am still confused about why it's not available on the client side.  I don't have a resource name called "Type" and I can access all attributes through the Appointment object in the code behind, even the attributes that use a reserved word.  I have not had any problem with this until I tried accessing it from the client side. 

It's not a big deal - I can change the name of my custom attribute to something like AttrType and hopefully that will work.  It's more of a curiosity thing at this point.

Thanks,
Laura
0
Peter
Telerik team
answered on 30 Jul 2009, 01:28 PM
Hi laura,

I understand your point. This seems like a peculiarity of RadScheduler caused by its inner workings related to custom attributes. I could inquire a detailed explanation from our development team if you really insist on understanging the cause of this problem. If not, try renaming the attribute names and let me know if this helps.


Best wishes,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Scheduler
Asked by
laura
Top achievements
Rank 1
Answers by
laura
Top achievements
Rank 1
Peter
Telerik team
Share this question
or