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

ID undefined on Client side

4 Answers 86 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Andy Green
Top achievements
Rank 2
Andy Green asked on 08 Apr 2016, 03:41 PM

HI

What would cause this line to return Undefined. This was working in the VB version, but I'm redoing it in C# binding to an oData webservice deserialised using NewtonSoft.json library.

function OnClientAppointmentClick(sender, eventArgs) {
var booking_id = eventArgs.get_appointment().get_attributes().getAttribute("Id");
alert(booking_id);

I have the id in the datasource and the following markin in the control.

DataKeyField="Id"
CustomAttributeNames="Id"
DataSubjectField="Descrption"
DataStartField="SlotStart"
DataEndField="SlotEnd"

4 Answers, 1 is accepted

Sort by
0
Andy Green
Top achievements
Rank 2
answered on 12 Apr 2016, 02:26 PM

I have got this working now:

var apt = eventArgs.get_appointment();
var booking_id = apt.get_id();

Andy

0
Nencho
Telerik team
answered on 13 Apr 2016, 12:17 PM
Hello Andy,

Thank you for sharing your solution with the community.

Regards,
Nencho
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Alla
Top achievements
Rank 1
answered on 22 Sep 2016, 08:31 PM

Hello Andy

Sorry to bother you. I need to setup a OData binding service, connecting to SQL to pull events on the scheduler, and never done it before. Is there a website link you can point me to or sample of the code? Thanks!

0
Andy Green
Top achievements
Rank 2
answered on 23 Sep 2016, 07:40 AM

Hi Alla

We gave up trying to use oData - the endpoints were returning JSon and not XML, and couldn't bind but mainly because we needed the OnappointmentCreated event on the server and oData seemed to be only on the client.

I too hadn't used oData before, so had to go back to what I know as we were running out of time.

I have found it easier to search using google, rather than the Telerik search above, so give that a try.

Other wise there are some samples in the Telerik help or search the forums.

Sorry I cant be any help

Andy

Tags
Scheduler
Asked by
Andy Green
Top achievements
Rank 2
Answers by
Andy Green
Top achievements
Rank 2
Nencho
Telerik team
Alla
Top achievements
Rank 1
Share this question
or