RadTreeView obj is null in JavaScript

2 posts, 0 answers
  1. Prasad
    Prasad avatar
    40 posts
    Member since:
    Sep 2011

    Posted 18 Jan 2013 Link to this post

    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

  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2062 posts

    Posted 22 Jan 2013 Link to this post

    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.
Back to Top