Unplanned
Last Updated: 15 Sep 2022 14:26 by ADMIN
Van
Created on: 09 Mar 2020 14:37
Category: FileExplorer
Type: Bug Report
2
Tree scroll position not maintained on node selection
The folder pane scrolling position is not persisted when the first child folder is selected.
 
 
Steps to reproduce:
1. Open https://demos.telerik.com/aspnet-ajax/fileexplorer/examples/overview/defaultcs.aspx
2. Add several folders to the last node
3. Scroll down to the bottom and select the first child folder of the last node
 
Result: The tree is scrolled to top.
8 comments
ADMIN
Peter Milchev
Posted on: 15 Sep 2022 14:26

Hi Sathiya,

To ensure better support service and avoid spamming this public feedback item, please open a support ticket for your issue, indicating this item as a reference. 

In the ticket, please include the markup (.aspx) and code-behind (.aspx.cs or .vb) files of the page that contains the FileExplorer. 

For testing purposes, you can open the FileExplorer page directly in the browser, not inside the iframe.

Additionally, please make a Fiddler Jam capture with our free browser extension(no registration needed) of the page containing the FileExplorer. Keep in mind that starting from a blank page or navigating to the page from the address bar after the capturing is started is crucial to ensure all the requests are included in the capture.

In the meantime, please ensure there are no JavaScript errors in the browser's console:

If the FileExplorer is initially hidden, this could also lead to the workaround not being applied. To fix that, you can try wrapping the <script> tag with a RadScriptBlock.

Regards,
Peter Milchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Sathiya
Posted on: 15 Sep 2022 14:08

Thanks for the quick response Peter.

This is what exactly I am doing as well.

Below is the skeleton of the aspx page which is hosting the file explorer.

<form>

<telerik:RadScriptManager runat="server" ID="IDRadScriptManager" AsyncPostBackTimeout="3600"/> 

<some controls here>

<telerik:RadFileExplorer/>

<Few more custom controls>

<script>

------The script you provided--------

</script

</form>

ADMIN
Peter Milchev
Posted on: 15 Sep 2022 14:01

Hi Sathiya,

If the FileExplorer page is loaded inside of an iframe, then no scripts loaded in the parent page will be propagated to the iframe. 

In this case, you should add the script to the .aspx page with the FileExplorer.

Regards,
Peter Milchev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Sathiya
Posted on: 15 Sep 2022 13:40

Hi Peter,

Yes, I am adding the script just before the close of form tag and RadScriptmanager is declared at very first line after form open tag.

Do we need to handle it differently for  <telerik:RadScriptManager> ?

Also, the aspx page which hosts the RadFileExplorer is embedded within <imodframe> of another aspx page.

Thanks

Sathiya

ADMIN
Peter Milchev
Posted on: 15 Sep 2022 09:30

Hello Sathiya,

Could you please ensure you place the script after the declaration of the ScriptManager? For example, try placing it near the end of the closing </form> tag of the MasterPage, or aspx page. You can add a validation if the Telerik scripts are already loaded on the page and that there is a FileExplorer on the page:

** some other code here ** 

<script>
            if (Telerik && Telerik.Web.UI.RadFileExplorer) {
                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>
    </form>
</body>
</html>

Regards,
Peter Milchev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Sathiya
Posted on: 08 Sep 2022 09:35

Hello Peter,

 

I tried the workaround you gave but always the script manager loads after the script you gave. So, the solution you provided is not working.

How do I ensure that this overwritten method loads after script manager?

 

 

Thanks,

Sathiya

ADMIN
Peter Milchev
Posted on: 26 Jul 2022 11:43

Hello Sathiya,

The forum thread below contains the workaround which can be used until the issue is fixed: 

In general, the following code should be added/loaded somewhere after the script manager of the page, ideally near the closing </form> tag.

 <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,
Peter Milchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Sathiya
Posted on: 30 Jun 2022 03:05

Hello Telerik Team,

Do we have any update on this issue? Can this be prioritized?

Our end customers are dealing with long list of files daily and this scrolling issue is frustrating them.

If this is gonna take time, kindly provide a workaround atleast.

Thanks,

Sathiya