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

Tree scroll position not maintained on node selection

6 Answers 500 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Van
Top achievements
Rank 1
Iron
Iron
Van asked on 04 Mar 2020, 10:27 PM

 

We use the RadFileExplorer to display a large set of folders and content.  However we have run into the issue that when the user scrolls down in the treeview and selects a subnode,  the tree does not maintain it's scroll position always to show the selected node.  Instead jumps back to top of view.  Strangely, this behavior seems to effect mostly the 1st subnode in the tree.  If a node had multiple sub-nodes, clicking a subnode other than first results in the tree maintaining scroll position correctly.  Attached PNG shows a simple test program we created that isolates the issue to a small web app based on your demo code.  I can provide the simple web app for your review to diagnose this issue if that is helpful. 

At moment am lost on how to proceed to correct this issue.

Note:  none of the RadFileExplorer demos online show this issue - there is not enough content in the tree view for it to scroll off bottom of view and have a scrollbar.

 

 

 

 

 

 

 

6 Answers, 1 is accepted

Sort by
0
Van
Top achievements
Rank 1
Iron
Iron
answered on 05 Mar 2020, 01:47 PM
Actually you can create this issue on the RadFileExplorer demo page.  On the "Overview" demo - if you add multiple tree nodes such that content scroll off bottom and then create  a few subnodes - the same behavior occurs.  Selecting sub-nodes "other" than first sub-node maintain the scroll position.  Selecting the first subnode results in the scroll position to reset.  See attached screen cap.
0
Vessy
Telerik team
answered on 09 Mar 2020, 02:44 PM

Hi Van,

Thank you for bringing this issue to our attention. I managed to reproduce it and logged it fur a further investigation in our bug tracking system. You can follow the progress of the item here:

https://feedback.telerik.com/aspnet-ajax/1457024

In addition, I have also added 1000 Telerik points to your account.

Regards,
Vessy
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
0
Van
Top achievements
Rank 1
Iron
Iron
answered on 11 Mar 2020, 06:46 PM

Hi Vessy,

Thank you for adding this to the bug tracking system.  Are you aware of a workaround I can use until corrected???  I have tried several approaches based on getting a reference to the radtreeview  and after the ajax call using scrollIntoView.  However none of my attempts have been successful.  Since our treeview in production is over 5000 nodes at first level,  am fielding numerous requests from our clients to correct.

0
Vessy
Telerik team
answered on 16 Mar 2020, 03:48 PM

Hi Van,

You can add the following overwrite temporary, which will disable the applying of the broken scroll-into-view logic when a node is clicked:

        <script>
            Telerik.Web.UI.RadFileExplorer.prototype.set_currentDirectory = function (value, addToStack)
            {
                //add to back/forward stack
                if ((null != this._actionsManager) &&
                    (value != this.get_currentDirectory()) &&
                    (false != addToStack)
                    )
                    this._updateBackForward(value); // Is true

                var currentDirectoryInputElement = this._getCurrentDirectoryElement();
                if (currentDirectoryInputElement) currentDirectoryInputElement.value = value;
                var tree = this.get_tree();
                var node = tree.findNodeByValue(value);
                if (node)
                {
                    node.select();

                    //we cannot use tree's scrollIntoView due to the tree/splitter declarations
                    //this._scrollFolderIntoView(node);
                }

                var textboxID = this.get_addressBox();
                if (textboxID)
                {
                    var textbox = $get(textboxID);
                    if (textbox)
                    {
                        textbox.value = value;
                    }
                }

                //update toolbar
                this._updateToolbar();
            }
        </script>

 

Regards,
Vessy
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
0
Van
Top achievements
Rank 1
Iron
Iron
answered on 16 Mar 2020, 07:35 PM

Hi Vessy,

That works great!!!!!

Thank you,

Van

 

 

 

 

0
Vessy
Telerik team
answered on 17 Mar 2020, 06:55 AM

Hi,

You are welcome, Van - I am really glad the suggested workaround served its purposes :)

Regards,
Vessy
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
Tags
FileExplorer
Asked by
Van
Top achievements
Rank 1
Iron
Iron
Answers by
Van
Top achievements
Rank 1
Iron
Iron
Vessy
Telerik team
Share this question
or