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

[Solved] window.onload

1 Answer 196 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jason Lee
Top achievements
Rank 1
Jason Lee asked on 22 May 2008, 11:09 AM
Hello Sir,

I call tree client-side object on "window.onload" event.
However, it return null...( I think the reason is the tree object is not initialized yet )

Therefore, I put my code on "pageLoad" event, and it works well.

My question is where is the best place that my code will be executed after the tree client-side object is  initialized?? 

Moreover, I have read the document of asp.net ajax.  It say

"Raised after all scripts have been loaded and all objects in the application that are created by using $create are initialized. The load event is raised for all postbacks to the server, which includes asynchronous postbacks."

I have put some code inside the pageLoad event, but it doesn't be executed after loading new nodes (load-on-demand, with webservice)
Why? I thought it should be executed after asynchronous postbacks.

Thank you


1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 22 May 2008, 11:27 AM
Hi Jason Lee,

As you have noticed the pageLoad method is not fired after RadTreeView performs load on demand request. Indeed the load on demand request falls in the "asynchronous postback" category. However it is implement via the ASP.NET 2.0 Callbacks instead of ASP.NET Ajax partial updates.

As a workaround I suggest you use the OnClientNodePopulated client-side event of your treeview which fires after load on demand requests.

I hope this helps,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
Jason Lee
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or