Nov 22, 2010, 8:30 AM
[CLOSED] [1.0 RC1] PagingToolbar fails with HttpProxy.
Hi,
i've added a PagingToolbar that works on client-side only.
If i use a HttpProxy to fill the store the paging fails.
Is this a bug or is it the default behaviour? Am i forced to use remote paging?
i've added a PagingToolbar that works on client-side only.
If i use a HttpProxy to fill the store the paging fails.
Is this a bug or is it the default behaviour? Am i forced to use remote paging?
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
</script>
<!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>
<script type="text/javascript">
</script>
</head>
<body>
<ext:ResourceManager ID="ResourceManager" runat="server" ScriptMode="Debug" />
<ext:Store runat="server" ID="DataStore">
<Proxy>
<ext:HttpProxy Method="GET" Url="handlers/GetData.ashx" />
</Proxy>
<Reader>
<ext:JsonReader IDProperty="Id">
<Fields>
<ext:RecordField Name="Id" Type="Int" />
<ext:RecordField Name="Name" Type="String"/>
</Fields>
</ext:JsonReader>
</Reader>
<SortInfo Field="Id" Direction="ASC" />
</ext:Store>
<ext:GridPanel
runat="server"
ID="GridPanel"
StoreID="DataStore"
Title="Table"
Icon="Table"
Frame="true"
AutoHeight="false"
Height="800"
Width="400">
<ColumnModel runat="server">
<Columns>
<ext:Column Header="ID" DataIndex="Id" ColumnID="id" />
<ext:Column Header="Name" DataIndex="Name" ColumnID="name" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel runat="server" />
</SelectionModel>
<BottomBar>
<ext:PagingToolbar
runat="server"
PageSize="4"
DisplayInfo="true"
DisplayMsg="Displaying data {0} - {1} of {2}"
EmptyMsg="No data to display" />
</BottomBar>
</ext:GridPanel>
</body>
</html>
<%@ WebHandler Language="C#" Class="GetData" %>
using System;
using System.Web;
using System.Collections.Generic;
using Ext.Net;
public class GetData : IHttpHandler {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "application/json";
context.Response.Write(JSON.Serialize(GetDataList()));
}
private List<Data> GetDataList()
{
return new List<Data>
{
new Data { Id = 1, Name = "Data1" },
new Data { Id = 2, Name = "Data2" },
new Data { Id = 3, Name = "Data3" },
new Data { Id = 4, Name = "Data4" },
new Data { Id = 5, Name = "Data5" },
new Data { Id = 6, Name = "Data6" },
new Data { Id = 7, Name = "Data7" },
new Data { Id = 8, Name = "Data8" },
new Data { Id = 9, Name = "Data9" },
new Data { Id = 10, Name = "Data10" },
new Data { Id = 11, Name = "Data11" },
new Data { Id = 12, Name = "Data12" },
new Data { Id = 13, Name = "Data13" },
new Data { Id = 14, Name = "Data14" },
new Data { Id = 15, Name = "Data15" },
};
}
public class Data
{
public int Id { get; set; }
public string Name { get; set; }
}
public bool IsReusable {
get {
return false;
}
}
}
Last edited by Daniil; Nov 22, 2010 at 11:28 PM.
Reason: [CLOSED]