PDA

View Full Version : [CLOSED] GridPanel scrolls document when getting focus



FVNoel
Mar 13, 2013, 11:38 AM
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?

Daniil
Mar 13, 2013, 12:03 PM
Hi @FVNoel,

Please provide a test case to reproduce.

FVNoel
Mar 13, 2013, 12:45 PM
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:
5811

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

5812

Losing view of the Labels.

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

Daniil
Mar 13, 2013, 3:58 PM
Thank you.

It doesn't scrolls for me.

What are a browser and Ext.NET version?

FVNoel
Mar 13, 2013, 4:06 PM

Daniil
Mar 13, 2013, 4:26 PM
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?

FVNoel
Mar 13, 2013, 5:09 PM
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/Ext.NET.Pro/Ext.NET.WebForms.Pro.2.1.1.zip

We are using the framework 4.0 version.

Baidaly
Mar 13, 2013, 11:39 PM
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?

Daniil
Mar 14, 2013, 5:03 AM
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.

FVNoel
Mar 14, 2013, 8:44 AM
We will wait for the 2.2 release then. Thank you for your reply.