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

RadTreeView obj is null in JavaScript

1 Answer 90 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Prasad
Top achievements
Rank 1
Prasad asked on 18 Jan 2013, 07:36 AM

Hi,
I am getting obj for radtreeview in javascript by using document.getElementById(...) but same thing is not getting by using $find(..).
If i get obj form the documnet class i am not able to get nodes form the tree obj... My code is looks like

<telerik:RadScriptBlock ID="rcb" runat="server">

 <script type="text/javascript">

 debugger;

 

Generate_WhereCondition1();

 

</script>

 -- Generate_WhereCondition1() logic is follows;
var tree = $find("<%= tvfltview.ClientID %>"); // here i am getting null -- type 1

 

 if(tree==null)

tree=document.getElementById("<%= tvfltview.ClientID %>"); // here i am getting obj -- type 2

 

</telerik:RadScriptBlock>

but i can getting error for tree.get_nodes(); from type 2

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 22 Jan 2013, 04:44 PM
Hello,

You are retrieving a null value for the tree object, because at this moment our RadTreeView client-side object is not initialized yet. I would suggest you to subscribe to some of RadTreeView client-side events to find and manipulate  the RadTreeView client-side object. Please review our RadTreeView client-side programming section in order to find detailed information about its available properties and methods.
The document method getElementById is returning a DOM element which is different than the RadTreeView client-side object. This is the reason why that object does not offer all methods and properties that are available by using our RadTreeView client-side object. 

Kind regards,
Boyan Dimitrov
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.
Tags
General Discussions
Asked by
Prasad
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or