I have the following problem.
I have a tree view control in .NET and I have created a autocomplete search box to search the tree for a name - which then I can select and it highlights the item with a selected class.
The tree view is pretty long so I have given it a height and overflow scroll.
The problem is that I want view or scroll down to the selected item when I've searched for it.
So i have created the following script to scrollIntoView it but this doesn't seem to work:
function search_itemSelected(sender, e) {
var hdSearchID = $get('<%= hdSearchID.ClientID %>');
hdSearchID.value = e.get_value();
var selectedElement = $(div.node.cen.selected); // This works
if (selectedElement != null) {
selectedElement[0].scrollIntoView = 10; // This keeps coming back as undefined
}
}