Problem Getting Client RadScheduler Reference

5 posts, 1 answers
  1. Marbry
    Marbry avatar
    123 posts
    Member since:
    Aug 2012

    Posted 08 Jan 2013 Link to this post

    I'm using the normal jquery to retrieve a reference to the scheduler like below.  The problem is that it only works sometimes.  With no code changes it might work once, then immediately after that not.  sched would just return as null.

    var sched = $find('RadScheduler1');

    I've tried different variations, and I can get a reference to the emitted <div> element, but it won't have any of the Telerik properties or methods hooked up.

    ETA - it seems it might be related to the VS environment.  If I open it from there with debugging, it occurs much more than without or opening it directly from IIS.

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Jan 2013 Link to this post

    Hi Marby,

    Try accessing the RadScheduler as follows.

    JS:
    var sched=$find("<%= RadScheduler1.ClientID %>");

    Hope this helps.

    Regards,
    Princy.
  3. Marbry
    Marbry avatar
    123 posts
    Member since:
    Aug 2012

    Posted 09 Jan 2013 Link to this post

    No, that's what I had originally.  I hard coded the client ID (confirmed that's what was being emitted) just to eliminate another potential point of error.

    The ID is correct, and like I said I can get a reference to the HTML element using document.getElementById() for instance, but it won't have any of the Telerik code hooked up to the returned object.
  4. Answer
    Plamen
    Admin
    Plamen avatar
    3080 posts

    Posted 10 Jan 2013 Link to this post

    Hello Marbry,

     
    One possible reason for such behavior may be that the HTML is generated but the client side object is not yet. Please refer to this blog post where similar issue have been explained.

    If this doesn't help please share what is the exact javascript error that is occurring and share more information about the exact event where you are trying to find RadScheduler.

    Hope this will be helpful.

    Greetings,
    Plamen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Marbry
    Marbry avatar
    123 posts
    Member since:
    Aug 2012

    Posted 10 Jan 2013 Link to this post

    Yes that was it, thanks!
Back to Top