Mar 04, 2009, 4:58 AM
[FIXED] [V0.8.0] GridPanel scrollbar
Hi Vlad,
please, check the following code. I reproduced the error.
Now in a GridPanel with vertical scrollbar, if people click the last row, scrollbar scrolls to top.
The effect is as it executes a code like that:
Matteo
Steps:
- scroll to bottom
- click row
- scrollbar scrolls to top
please, check the following code. I reproduced the error.
Now in a GridPanel with vertical scrollbar, if people click the last row, scrollbar scrolls to top.
The effect is as it executes a code like that:
gridPanel.getView().scrollToTop();
ThanxMatteo
Steps:
- scroll to bottom
- click row
- scrollbar scrolls to top
// DESIGN
<ext:ScriptManager ID="ScriptManager1" runat="server" AjaxViewStateMode="Include" />
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="Name" />
<ext:RecordField Name="Price" />
<ext:RecordField Name="Change" />
<ext:RecordField Name="PctChange" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<br />
<h1>scrollbar grid</h1>
<ext:GridPanel ID="GridPanel2" runat="server" StoreID="Store1" StripeRows="true"
Title="Company List" Width="600" Height="200">
<SelectionModel>
<ext:RowSelectionModel ID="rowSel" runat="server"></ext:RowSelectionModel>
</SelectionModel>
<ColumnModel ID="ColumnModel2" runat="server">
<Columns>
<ext:Column ColumnID="Company" Header="Company" Sortable="true" DataIndex="Name" />
<ext:Column Header="Price" Sortable="true" DataIndex="Price">
<Renderer Format="UsMoney" />
</ext:Column>
<ext:Column Header="Change" Sortable="true" DataIndex="Change">
<Renderer Fn="change" />
</ext:Column>
<ext:Column Header="Change" Sortable="true" DataIndex="PctChange">
<Renderer Fn="pctChange" />
</ext:Column>
</Columns>
</ColumnModel>
</ext:GridPanel>
// CODE
protected void Page_Load(object sender, EventArgs e)
{
Company _c = new Company("3m Co", 71.72, 0.02, 0.03);
Company _c1 = new Company("Coolite Inc.", 79.72, 0.02, 0.03);
List<Company> _l = new List<Company>();
_l.Add(_c);
_l.Add(_c1);
_l.Add(_c);
_l.Add(_c1);
_l.Add(_c);
_l.Add(_c1);
_l.Add(_c);
_l.Add(_c1);
_l.Add(_c);
_l.Add(_c1);
this.Store1.DataSource = _l;
this.Store1.DataBind();
}
public class Company
{
private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
private double _price;
public double Price
{
get { return _price; }
set { _price = value; }
}
private double _change;
public double Change
{
get { return _change; }
set { _change = value; }
}
private double _pctChange;
public double PctChange
{
get { return _pctChange; }
set { _pctChange = value; }
}
public Company(string name, double price, double change, double pctChange)
{
this.Name = name;
this.Price = price;
this.Change = change;
this.PctChange = pctChange;
}
}