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

[Solved] Problem getting client-side references using $find()

2 Answers 96 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Michael Kane
Top achievements
Rank 1
Michael Kane asked on 14 Apr 2009, 01:09 AM
I've put the following code below my scheduler:

var Scheduler = $find("<%=RadScheduler.ClientID%>"); 

But then when I call (in Firebug)

console.log(Scheduler); 

It returns null.

I managed to work around it by handling the OnClientDataBound event . . . . I just save the "sender" parameter as a global variable.

But now I need a reference to a RadAjaxManager. Since I can't seem to use the $find() syntax, and since RadAjaxManager doesn't have an equivalent event I can handle as a workaround, what can I do to get a client-side reference?

(I'm using jQuery if that affects anything)

Thank you,

Michael

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 14 Apr 2009, 09:14 AM
Hello Michael Kane,

This is very strange. The $find function should always work provided there are no client-side errors. Please check if there is $create JavaScript statement rendered at the end of your page:
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadScheduler, {/*some code here*/}, null, null, $get("RadScheduler1"));

I strongly recommend you send us a running version of your page so we can troubleshoot. To do so please open a support ticket.

Regards,
Albert
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Michael Kane
Top achievements
Rank 1
answered on 16 Apr 2009, 12:21 AM
Hmmm . . it's working now.

I think that <%= RadScheduler.ClientID %> wasn't working properly . . . . if I use a hard-coded client ID, I can get a reference to the AjaxManager.

Thank you,

Michael
Tags
Scheduler
Asked by
Michael Kane
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Michael Kane
Top achievements
Rank 1
Share this question
or