PDA

View Full Version : [CLOSED] ext.net paging problem



tobros
Sep 06, 2013, 11:03 AM
I have set store's pagesize property , and add pagingtoolbar, but dose not page.


<ext:Store runat="server" ID="store1" PageSize="20">
....
<BottomBar>
<ext:Toolbar runat="server">
<Items>
<ext:PagingToolbar runat="server"></ext:PagingToolbar>
</Items>
</ext:Toolbar>
</BottomBar>


ext.net version 2.2.0.16826

6858

tobros
Sep 06, 2013, 11:04 AM
public partial class cashflow_report_prj_set : System.Web.UI.Page
{
CashFlowItemService cashFlowItemService = new CashFlowItemService();
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
store1.DataSource = cashFlowItemService.AllData();
store1.DataBind();
}
}
}

tMp
Sep 06, 2013, 11:23 AM
Hi @trobros

As far as I can tell you forgot to link the PagingToolbar to the store. Check out the basic example (http://examples2.ext.net/#/DataView/Basic/With_Paging/)!


<ext:PagingToolbar runat="server" StoreID="Store1" />

Hope that helps.

Daniil
Sep 06, 2013, 12:46 PM
Hi @tobros,

I cannot reproduce it with this test case. Please provide your one.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Store store = this.GridPanel1.GetStore();
store.DataSource = new object[]
{
new object[] { "test1" },
new object[] { "test2" },
new object[] { "test3" },
new object[] { "test4" },
new object[] { "test5" },
new object[] { "test6" },
new object[] { "test7" },
new object[] { "test8" },
new object[] { "test9" }
};
}
}
</script>

<!DOCTYPE html>

<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:GridPanel ID="GridPanel1" runat="server">
<Store>
<ext:Store runat="server" PageSize="3">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="test" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="Test" DataIndex="test" />
</Columns>
</ColumnModel>
<BottomBar>
<ext:PagingToolbar runat="server" />
</BottomBar>
</ext:GridPanel>
</form>
</body>
</html>

Hi @tMp,

First of all, thank for posting!

As for your comment. If a PagingToolbar is put into a GridPanel's BottomBar, then setting up its StoreID should not be required. However, there was a bug. I do not remember it was fixed before v2.2 release or after. So, @tobros, please try to set up the PagingToolbar's StoreID.