Apr 04, 2013, 3:03 AM
PageSize problem
Hi
I'm using a DataView which I have attached a PagingToolbar to which works fine if I populate data in code behind like this:
Here is my markup
Thanks
Glen
I'm using a DataView which I have attached a PagingToolbar to which works fine if I populate data in code behind like this:
public void Initialise(IEnumerable data)
{
DataView1.GetStore().Data = data;
}
But if I populate using a PageProxy with a DirectMethod then the pagesize is ignored and all records are shown?[DirectMethod]
public object GetData()
{
using (QuoteController qc = new QuoteController())
{
var quotes = qc.GetUpcomingQuotes(20);
List<object> q = new List<object>();
foreach (QuotePickList pl in quotes)
{
q.Add(new
{
Type = 2,
Title = pl.QuoteId + " - " + pl.Name,
Dates = pl.StartDate.Value.ToString("dd MMM yy") + " - " + pl.CompletionDate.Value.ToString("dd MMM yy"),
Assigned = 0f,
pl.Required,
Percentage = pl.ChanceWinning
});
}
return q;
}
}
Here is my markup
<ext:DataView ID="DataView1"
runat="server"
OverItemCls="x-view-over"
TrackOver="true"
ItemSelector="div.gridRow">
<Store>
<ext:Store ID="storeView" runat="server" PageSize="5">
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="Type" Type="Int" />
<ext:ModelField Name="Title" />
<ext:ModelField Name="Dates" />
<ext:ModelField Name="Assigned" Type="Float" />
<ext:ModelField Name="Required" Type="Float" />
<ext:ModelField Name="Percentage" Type="Float" />
</Fields>
</ext:Model>
</Model>
<Proxy>
<ext:PageProxy DirectFn="App.direct.GetData" />
</Proxy>
</ext:Store>
</Store>
<Tpl ID="Tpl1" runat="server">
<Html>
<tpl for=".">
<div class="gridRow">
<div class="topRow"><a class="description" href="#">{Title}</a></div>
<dl><dt><span class="icon icon-calendar"></span></dt><dd>{Dates}</dd><dt><span class="icon icon-personell-required"></span></dt><dd>{Required}</dd><dt><span class="icon icon-personell-added"></span></dt><dd>{Assigned}</dd><dt></dt><dd><div class="progressBar">
<div id="progressInner" runat="server" style="width:{Percentage}px" class="progressBar-inner"></div></div></dd></dl>
</div>
</tpl>
<div class="x-clear"></div>
</Html>
</Tpl>
</ext:DataView>
<ext:PagingToolbar ID="PagingToolbar1" runat="server" StoreID="storeView" HideRefresh="true" />
Is there something I need to do to ensure that the PageSize property in the Store is adhered to?Thanks
Glen