[CLOSED] Paging Toolbars on DataViews

  1. #1

    [CLOSED] Paging Toolbars on DataViews

    I've been unable to get a Paging Toolbar to work properly with DataViews. In short the e.Total is not being calculated by the toolbar. I do get the e.Start and e.Limit. However, the PagingToolbar thinks that the limit is the count.

    I rebuilt into a very simple example.

    namespace TestExt
        public partial class Default : System.Web.UI.Page
            private string[] names =
    @"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"
    .Replace(",", "").Replace("  ", " ").Split(' ');
            protected void Page_Load(object sender, EventArgs e)
            // FIRST TRY
            protected void DocList_Refresh(object sender, StoreReadDataEventArgs e)
                if (X.IsAjaxRequest)
                    List<sample> foobar = new List<sample>();
                    for (int i = 0; i < 50; i++)
                        foobar.Add(new sample() { Date = DateTime.Now.AddDays(i), Id = i, Name = names[i] });
                    e.Total = foobar.Count();
                    this.StoreDocumentList.DataSource = foobar.Skip(e.Start).Take(e.Limit);
            // SECOND TRY
            public object BindData(string action, Dictionary<string, object> extraParams)
                var iStart = 0;
                var iLimit = 10;
                if (extraParams != null)
                    StoreRequestParameters prms = new StoreRequestParameters(extraParams);
                    iStart = prms.Start;
                    iLimit = prms.Limit;
                List<sample> foobar = new List<sample>();
                for (int i = 0; i < 50; i++)
                    foobar.Add(new sample() { Date = DateTime.Now.AddDays(i), Id = i, Name = names[i] });
                return foobar.Skip(iStart).Take(iLimit);
        public class sample
            public int Id { get; set; }
            public string Name { get; set; }
            public DateTime Date { get; set; }


     <form id="form1" runat="server">
            <ext:resourcemanager runat="server">
            <ext:Panel runat="server" ID="pnl1">
                    <ext:Hidden ID="HiddenPersonId" runat="server">
                    <ext:DataView ID="dvDocumentList"
                                <ext:Store ID="StoreDocumentList" runat="server" IDMode="Static" PageSize="10" OnReadData="DocList_Refresh">
                                   <%-- <Proxy>
                                        <ext:PageProxy DirectFn="App.direct.BindData" />
                                        <ext:Model ID="Model1" runat="server">
                                                <ext:ModelField Name="Id" />
                                                <ext:ModelField Name="FileName" />
                                                <ext:ModelField Name="Date"  DateFormat="mm/dd/YYYY"  />  
                            <Tpl ID="Tpl1" runat="server">
                            <table class="tbl">                    
                            <tpl for=".">                                                                
                                <tr class="customer-record">                                                    
                                        <label>Record {Id}</label>
                                    <br />
                                    <p />
                    <ext:PagingToolbar ID="PagingToolbar1" runat="server" StoreID="StoreDocumentList" HideRefresh="false">
    Last edited by Daniil; Mar 11, 2014 at 6:38 AM. Reason: [CLOSED]
  2. #2
    Hi @Juls,

    You have to return the total amount from the BindData method. As here:

Similar Threads

  1. Replies: 0
    Last Post: Feb 27, 2012, 5:26 AM
  2. Replies: 1
    Last Post: Aug 22, 2011, 5:54 PM
  3. [CLOSED] Width of toolbars and headers on a Grid
    By wazige in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 07, 2010, 10:20 AM
  4. Multiple toolbars emulation
    By Vladimir in forum Examples and Extras
    Replies: 4
    Last Post: Sep 24, 2009, 6:18 AM
  5. [CLOSED] Toolbars and Menus in extjs....
    By king1231986 in forum 1.x Help
    Replies: 1
    Last Post: Nov 06, 2008, 4:40 AM

Tags for this Thread

Posting Permissions