I am having a problem with accessing the treeview in javascript during the page load. I need to do some work before my page finishes loading but it seems as though the treeview is one of the last things initialized on the page, thus I am not able to access it in JS.
I am doing the following:
But the html output shows this:
As you can see the treeview is not getting initialized until after I am trying to call it. Is there a way around this? Is there a way to give us a method that is called after the preinitalize so we can add our own code to?
Jason
I am doing the following:
| ScriptManager.RegisterStartupScript(this.Page, typeof (string),"start", |
| string.Format( |
| "mainTree = $find('{0}');window.ChangeDataContents(mainTree.get_selectedNode());", |
| this.RadTreeView1.ClientID), true); |
But the html output shows this:
| <script type="text/javascript"> |
| //<![CDATA[ |
| mainTree = $find('ctl00_cph2_RadTreeView1');window.ChangeDataContents(mainTree.get_selectedNode());//]]> |
| </script> |
| <script type="text/javascript"> |
| //<![CDATA[ |
| Telerik.Web.UI.RadTreeView._preInitialize("ctl00_cph2_RadTreeView1","0"); |
| theFormtheForm.oldSubmit = theForm.submit; |
| theForm.submit = WebForm_SaveScrollPositionSubmit; |
As you can see the treeview is not getting initialized until after I am trying to call it. Is there a way around this? Is there a way to give us a method that is called after the preinitalize so we can add our own code to?
Jason