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

Problem Getting Client RadScheduler Reference

4 Answers 86 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Marbry
Top achievements
Rank 1
Marbry asked on 08 Jan 2013, 03:02 PM

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.

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 09 Jan 2013, 04:05 AM
Hi Marby,

Try accessing the RadScheduler as follows.

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

Hope this helps.

Regards,
Princy.
0
Marbry
Top achievements
Rank 1
answered on 09 Jan 2013, 02:56 PM
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.
0
Accepted
Plamen
Telerik team
answered on 10 Jan 2013, 08:10 AM
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.
0
Marbry
Top achievements
Rank 1
answered on 10 Jan 2013, 02:16 PM
Yes that was it, thanks!
Tags
Scheduler
Asked by
Marbry
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Marbry
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or