I'm trying to set some tree nodes from the client side once the page loads using the code below:
var tree = $find(clientId);
var allTreeNodes = tree.get_allNodes();
However I get the error below when I try to run it in $(document).ready or $(window).ready.
Microsoft JScript runtime error: Unable to get value of the property 'get_allNodes': object is null or undefined.
So basically it doesn't find the tree. I tested it with jQuery using $("#" + clientId).length and it returns 1 so it exists.
The only time it works is in the pageLoad() which I think is an asp.net ajax method. Can someone explain why this is the case?