Return a scrolling Treeview to same spot after pageback

S

Steve

I have been beating my head against a wall trying to get my treeview to
return to the same scrolled to location after a postback. I have used
the following javascript to set the scroll for a div section with no
luck. The js runs, returns a valid current scroll value, but the
scrollTop stays at 0.

var scrollel=document.getElementById("divAdmFeedTree");

if(scrollel!=null)
{

var
scrollval=document.getElementById("ctl00_CPHBase_divAdmFeedTreeScroll");
//alert("S");
if(scrollval!=null && scrollval.value!=null)
{
alert(scrollval.value);
scrollel.scrollTop=scrollval.value;
alert(scrollel.scrollTop);

}
}

I have also used the following js code (and several different versions
of it) to set the ScrollintoView, also with no luck.

var name = "ctl00_CPHBase_tvCategories_SelectedNode";
var Node = document.getElementById(name);

if(Node!=null){

/var selectedNode=null;

if(Node.value!=null && Node.value.length>0)
{
selectedNode = document.getElementById(Node.value);
}
if(selectedNode!=null)
selectedNode.scrollIntoView(true);
selectedNode.focus();
}

A fresh set of eyes (or perspective) would be greatly appreciated.

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top