[CLOSED] GridPanel scrolls document when getting focus

  1. #1

    [CLOSED] GridPanel scrolls document when getting focus

    Hello,


    We are having a problem with a GridPanel. The thing is, when you click on the GridPanel, and it takes focus, the document is automatically scrolled to leave the GridPanel at the top, losing view of the items in top of the GridPanel. We would like to avoid this.

    Is there a way to avoid the GridPanel from moving the scroll of the page?
    Last edited by Daniil; Mar 14, 2013 at 9:55 AM. Reason: [CLOSED]
  2. #2
    Hi @FVNoel,

    Please provide a test case to reproduce.
  3. #3
    Here is a example:

    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test.aspx.vb" Inherits="JSSR.Test.PilotoExtNet.Test" %>
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    
    
        <script type="text/javascript">
    
    
            function loadData() {
                setTimeout(function () {
                    var data = [];
                    for (var i = 0; i < 1000; ++i) {
                        data.push({ Id: i + 1, Test: 'Hello ' + (i + 1).toString() });
                    }
                    App.Store1.loadData(data);
                }, 100);
            }
    
    
        </script>
    
    
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <ext:ResourceManager runat="server">
            </ext:ResourceManager>
    
    
            <ext:Viewport runat="server" Layout="FitLayout">
                <Items>
                    <ext:Panel runat="server" Region="Center" Layout="FormLayout" AutoScroll="true">
                        <Items>
                            <ext:Label ID="Label1" runat="server" Text="LABEL" />
                            <ext:Label ID="Label2" runat="server" Text="LABEL" />
                            <ext:Label ID="Label3" runat="server" Text="LABEL" />
                            <ext:Label ID="Label4" runat="server" Text="LABEL" />
                            <ext:Label ID="Label5" runat="server" Text="LABEL" />
                            <ext:Label ID="Label6" runat="server" Text="LABEL" />
                            <ext:Label ID="Label7" runat="server" Text="LABEL" />
                            <ext:Label ID="Label8" runat="server" Text="LABEL" />
                            <ext:Label ID="Label9" runat="server" Text="LABEL" />
                            <ext:Label ID="Label10" runat="server" Text="LABEL" />
                            <ext:GridPanel runat="server">
                                <Store>
                                    <ext:Store ID="Store1" runat="server" AutoDataBind="true" ClientIDMode="Static">
                                        <Model>
                                            <ext:Model ID="Model1" runat="server">
                                                <Fields>
                                                    <ext:ModelField Name="Id" />
                                                    <ext:ModelField Name="Test" />
                                                </Fields>
                                            </ext:Model>
                                        </Model>
                                        <Reader>
                                            <ext:ArrayReader IDProperty="Id" />
                                        </Reader>
                                    </ext:Store>
                                </Store>
                                <ColumnModel>
                                    <Columns>
                                        <ext:Column runat="server" ID="colId" DataIndex="Id" Text="Id" />
                                        <ext:Column runat="server" ID="colTest" DataIndex="Test" Text="Test" />
                                    </Columns>
                                </ColumnModel>
                                <View>
                                    <ext:GridView LoadMask="true" LoadingCls="Loading..." />
                                </View>
                                <SelectionModel>
                                    <ext:CellSelectionModel />
                                </SelectionModel>
                                <Listeners>
                                    <AfterRender Handler="loadData();" />
                                </Listeners>
                            </ext:GridPanel>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Viewport>
    
    
        </div>
        </form>
    </body>
    </html>
    Before clicking in the grid, we can see the following:
    Click image for larger version. 

Name:	beforeTargetingTheGrid.png 
Views:	117 
Size:	68.5 KB 
ID:	5811

    But when we click on a grid cell, the Grid automatically scrolls to the top of the document:

    Click image for larger version. 

Name:	afterTargetingTheGrid.png 
Views:	114 
Size:	54.5 KB 
ID:	5812

    Losing view of the Labels.

    We would like the document not to be scrolled at all when you click on a cell.
  4. #4
    Thank you.

    It doesn't scrolls for me.

    What are a browser and Ext.NET version?
  5. #5
    Last edited by FVNoel; Mar 13, 2013 at 4:09 PM.
  6. #6
    Quote Originally Posted by FVNoel View Post
    Ext.NET 2.1.1.18167
    Unfortunately, it doesn't provide enough information to conclude what Ext.NET you are actually using.

    What is a place where you got it?
  7. #7
    We have downloaded the Ext.NET libraries from the following URL:

    http://www.ext.net/download/

    from the link: Assemblies (.dll) only -> https://github.com/downloads/extnet/....Pro.2.1.1.zip

    We are using the framework 4.0 version.
  8. #8
    Hello!

    It's known bug in ExtJS: http://www.sencha.com/forum/showthread.php?133983 But it fixed now.

    Unfortunately, there is no workaround for CellSelectionModel only for RowSelectionModel. But we can investigate it more or you can wait until Ext.NET will migrate to ExtJS 4.2?
    Last edited by Baidaly; Mar 13, 2013 at 11:41 PM.
  9. #9
    Yes, it is not reproducible with the Ext.NET sources from the SVN trunk.

    ExtJS 4.2.0 final was just released. So, it takes a little time to release Ext.NET v2.2. It might happen next week.
  10. #10
    We will wait for the 2.2 release then. Thank you for your reply.

Similar Threads

  1. [OPEN] [#17] IE scrolls to top on row editor update
    By paulc in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 16, 2012, 7:23 AM
  2. [CLOSED] Datepicker automatically scrolls to itself on page load
    By jchau in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 16, 2010, 8:33 PM
  3. Replies: 0
    Last Post: Mar 30, 2010, 5:32 PM
  4. window mask scrolls body to top
    By [WP]joju in forum 1.x Help
    Replies: 0
    Last Post: Nov 18, 2009, 2:00 AM
  5. Replies: 0
    Last Post: Feb 12, 2009, 6:38 AM

Posting Permissions