Hi,
Using webdatatree in 'ModalDialog' pop up, tried using
node._element.scrollIntoView(tree); - But it throws exception saying 'type mismatch'.
node._element.scrollIntoView(true); - does not scroll into the node selected.
Please suggest asap.
Hi Vasya,
Thanks for the reply.
I tried the below code in my client side.
function WebDataTree1InitializeTree(sender, eventArgs){tree = sender;
if (tree.get_selectedNodes()[0] != null)
{ var node = sender.get_selectedNodes()[0]; var treeElement = sender.get_element(); sender._scrollToNode(node, treeElement); } }
This function is fine when the tree gets initialised for the first time.
But my requirement is that, on run time, i set the node using node.set_selected(true);, based on the search.
Inspite of the node getting selected, its doesnt scroll into view as this WebDataTree1InitializeTree does not get called everytime i set the node.
Can u please guide me on this.
Hello Jeevitha,
Thank you for posting in our community.
In order to scrollWebDataTree to the selected node what I can suggest is handling Initialize client side event. In this event you could scrollToNode function to scroll to any node of your choice. For example:
function WebDataTree1_Initialize(sender, eventArgs) { var tree = sender; var nodesCount = sender.getNodes().get_length(); var node = sender.getNodes().getNode(nodesCount - 1); var treeElement = sender.get_element(); sender._scrollToNode(node, treeElement); }
function WebDataTree1_Initialize(sender, eventArgs)
{
var tree = sender;
var nodesCount = sender.getNodes().get_length();
var node = sender.getNodes().getNode(nodesCount - 1);
var treeElement = sender.get_element();
sender._scrollToNode(node, treeElement);
}
Additionally, I noticed that the similar scenario has been discussed in the following forum thread that you might consider helpful:
http://es.infragistics.com/community/forums/t/51978.aspx
I hope you find my information helpful.
Please let me know if you need any further assistance with this matter.