I am using asp.net 2.0 , I have added a infra webtree with id trvRelationinfra but unable to access it with igtree_getTreeById, do I need to include any Javascript file related to Infragiostics controls? Following is the Javascript function, I think the problem is at 1st line with igtree_getTreeById, as -- alert("tree"); // gives message as "undefined"
function fn_getDetails() {
var tree = igtree_getTreeById("trvRelationinfra");
alert("tree"); // gives message as "undefined"
var node = tree.getNodeById("NodeID1");
var strID= node.DataKey;
alert(strID);
return false; }
As Darell said, most probably your treeview client (javascript) ID is different from the server-side "trvRelationinfra" ID. This is controlled by the framework (INamingContainer) and we cannot change that.
There a couple of approaches:
1. You can use directly the ClientID of the treeview using the following syntax:
var tree = igtree_getTreeById("<%= trvRelationinfra.ClientID %> ");
or
2. Use the client-side InitializeTree event to get an instance of the tree based on the client id and then use from this point thereafter:
<ignav:UltraWebTree ID="UltraWebTree1" runat="server" Editable="true"> <ClientSideEvents InitializeTree="initTree" /> ... </ignav:UltraWebTree> <script language="javascript"> var tree; function initTree(treeId) { tree = igtree_getTreeById(treeId); } </script>
hey i have one problem with treeview will yo please help me..
check this, http://forums.infragistics.com/forums/t/4974.aspx