Sep 18, 2009, 11:27 AM
[CLOSED] PagingToolbar
Hello,
If you demo the example below you will notice a minor bug in the GridPanel and PagingToolbar when the data source changes over an AjaxEvent.
Example:
1. Load page
2. Advance to page 3
3. Click Filter button
4. Notice you are on page 3 where there is only 1 page?
Cheers,
Timothy
If you demo the example below you will notice a minor bug in the GridPanel and PagingToolbar when the data source changes over an AjaxEvent.
Example:
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!Ext.IsAjaxRequest)
{
Store1.DataSource = new object[] {
new object[] { 1, "A" },
new object[] { 2, "B" },
new object[] { 3, "C" },
new object[] { 4, "D" },
new object[] { 5, "E" },
new object[] { 6, "F" },
new object[] { 7, "G" },
new object[] { 8, "H" },
new object[] { 9, "I" },
new object[] { 10, "J" }
};
Store1.DataBind();
}
}
protected void Button1_Click(object sender, AjaxEventArgs e)
{
Store1.DataSource = new object[] {
new object[] { 1, "A" },
new object[] { 2, "B" }
};
Store1.DataBind();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Example</title>
</head>
<body>
<form id="form1" runat="server">
<ext:ScriptManager ID="ScriptManager1" runat="server" />
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:ArrayReader ReaderID="Id">
<Fields>
<ext:RecordField Name="Id" />
<ext:RecordField Name="Name" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
<ext:GridPanel ID="GridPanel1" EnableViewState="true" AutoHeight="true" runat="server"
StoreID="Store1" Title="List" Icon="Application">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column Header="Id" Sortable="true" DataIndex="Id" />
<ext:Column Header="Name" Sortable="true" DataIndex="Name" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
</SelectionModel>
<BottomBar>
<ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="4" />
</BottomBar>
<LoadMask Msg="Loading" ShowMask="true" />
</ext:GridPanel>
<ext:Button ID="Button1" runat="server" Text="Filter">
<AjaxEvents>
<Click OnEvent="Button1_Click" />
</AjaxEvents>
</ext:Button>
</form>
</body>
</html>
Replication steps:1. Load page
2. Advance to page 3
3. Click Filter button
4. Notice you are on page 3 where there is only 1 page?
Cheers,
Timothy