ID undefined on Client side

5 posts, 0 answers
  1. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 08 Apr Link to this post

    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"

  2. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 12 Apr in reply to Andy Green Link to this post

    I have got this working now:

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

    Andy

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 13 Apr Link to this post

    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.
  5. Alla
    Alla avatar
    6 posts
    Member since:
    May 2016

    Posted 22 Sep in reply to Andy Green Link to this post

    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!

  6. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 23 Sep in reply to Alla Link to this post

    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

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017