[CLOSED] [1.0 RC1] PagingToolbar fails with HttpProxy.

  1. #1

    [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?


    <%@ 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]
  2. #2
    Hi,

    It's not a bug. When some Proxy is used clicking on a refresh button causes the request to proxy and you should process it by a respective way.

    Please see
    https://examples1.ext.net/#/GridPane...rting/Handler/
  3. #3
    Hi,

    Remote paging with HttpHandler is demonstrated in the following sample
    https://examples1.ext.net/#/GridPanel/Paging_and_Sorting/Handler/
    Do not forget to set AutoLoadParams if your store is auto loaded
    <AutoLoadParams>
        <ext:Parameter Name="start" Value="={0}" />
        <ext:Parameter Name="limit" Value="={4}" />
    </AutoLoadParams>

Similar Threads

  1. [CLOSED] Menu.ToConfig() fails in a service
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 13, 2012, 9:29 PM
  2. Localize gridpanel fails
    By jortega in forum 1.x Help
    Replies: 2
    Last Post: May 06, 2009, 12:21 PM
  3. Internationalize gridpanel fails
    By jortega in forum 1.x Help
    Replies: 0
    Last Post: Apr 28, 2009, 12:02 PM
  4. Button StyleSpec Fails
    By Timothy in forum Bugs
    Replies: 2
    Last Post: Aug 21, 2008, 7:33 PM
  5. [CLOSED] Latest build from SVN fails
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 03, 2008, 10:45 PM

Tags for this Thread

Posting Permissions