This is a migrated thread and some comments may be shown as answers.

scrollIntoView not working

10 Answers 315 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Som
Top achievements
Rank 1
Som asked on 14 Feb 2008, 09:37 PM
I am using "ServerSide" expand mode and using the following code to scroll to the last expanded node, but it is not working: 

        function ScrollToSelectedNode()
        {
                var tree = $find("<%= RadTreeView1.ClientID %>");
                //this was not working. so i used a hidden control to store the value of the last node clicked.
                //var selectedNode = treeviewInstance.SelectedNode;
                //The value of the expandedNode is set in the RadTreeView1_NodeExpand event on the server side
               var selectedNode = tree.findNodeByValue(document.getElementById("expandedNode").value);
               if (selectedNode != null)
               {
                selectedNode.select();
                selectedNode.scrollIntoView();
                //window.setTimeout(function() { selectedNode.scrollIntoView(); }, 200);
                }
        }


I will appreciate if you please help me out here.

10 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 18 Feb 2008, 04:26 PM
Hello Som,

Could you open a formal support ticket and send us a sample project where the problem occurs? This way it would be easier for us to trace the problem and eventually find a resolution.

Thank you in advance.

Regards,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Markus
Top achievements
Rank 2
answered on 15 May 2008, 01:42 PM
has this issue been solved in any way?

I'm struggeling too with this "scrollIntoView" method. My treeview is inside a radpanelbar
0
Simon
Telerik team
answered on 15 May 2008, 02:58 PM
Hi Markus,

We have recently resolved an issue with the scrollIntoView function. Still, we did not get a chance to examine Som's case and I am not sure the problem he referred to is the same as the one we have resolved.

I suggest you upgrade to the latest version of RadTreeView which should be available in a couple of hours.

If the problem still persists, feel free to send a Bug Report describing how it can be reproduced; a sample project will be of a great help. We will examine it right away.

Kind regards,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Markus
Top achievements
Rank 2
answered on 16 May 2008, 07:14 AM
Hi!

Just to be sure that I use the method in the right manner:

I have a node which is outside the visible area of the treeview, I call node.scrollIntoView() and actually the treeview should scroll down until the node is visible, right ?

With the new version it is still not working, I will try to set up a sample project where this occurs. I can't sent you the application itself ;-)

edit: is there a workaround in the meantime? lets say getting the parent div element and use the javascript scrollTo(x,y) method ?
0
Simon
Telerik team
answered on 19 May 2008, 11:06 AM
Hello Markus,

Which was the version you tested with?

In the latest version this bug has been resolved, scrollIntoView should scroll to the caller Node as expected. Still, if you experience problems, could you send a simple project which exhibits them? We will examine it right away.

Best wishes,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Markus
Top achievements
Rank 2
answered on 19 May 2008, 11:30 AM
I'm using this version: 2008.1.515.35
0
Simon
Telerik team
answered on 19 May 2008, 02:16 PM
Hi Markus,

I tried once again with the latest version of Telerik.Web.UI - v2008.1.515.35 and everything worked as expected.

I have attached the test project, so that you could check it out for yourself.

Please see this topic for more information about using the scrollIntoView function.

If you still experience the problem, please open a support ticket and send us a project demonstrating it. We will examine it and try to provide a solution/workaround.

Sincerely yours,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Markus
Top achievements
Rank 2
answered on 19 May 2008, 02:27 PM
Thanks for your quick response.
In the meantime I know these articles by heart ;-)

anyway, I'll try setting up a sample project that reproduces the error!


0
Markus
Top achievements
Rank 2
answered on 30 Sep 2008, 09:00 AM
Finally I found some time to care about this issues again.

The problem in my case was that the rad tree actually obtained the height it needed to display all nodes, but the scrollbars resulted from the parentcontainer. In my example a radmultipage with a fix height.

The scrollIntoView() method cant scroll its parent, unfortunately.

kind regards,
 markus


0
Nicolaï
Top achievements
Rank 2
answered on 22 Mar 2013, 11:46 AM
Landed here while... obviously... trying to solve a "scrollIntoView not working"..
In my case, specifying height on the treeview helped (nested as combo item)
Tags
TreeView
Asked by
Som
Top achievements
Rank 1
Answers by
Simon
Telerik team
Markus
Top achievements
Rank 2
Nicolaï
Top achievements
Rank 2
Share this question
or