[CLOSED] GridPanel - PagingToolbar - PageSize not working

  1. #1

    [CLOSED] GridPanel - PagingToolbar - PageSize not working

    Hi,
    I'm using a gridpanel with a pagingtoolbar, but it seems the pagesize property doesn't work on the first page.
    It works correctly on the following pages but on the first page, the grid loads all the records.

    Here below the code:

    <ext:GridPanel ID="gpSensorHistory" runat="server" Title="History" EnableColumnMove="false" EnableColumnHide="false" EnableColumnResize="false" >                        <Store>
                                <ext:Store ID="stSensorHistory" runat="server">
                                    <Reader>
                                        <ext:JsonReader>
                                            <Fields>
                                                <ext:RecordField Name="Value" Type="String" />
                                                <ext:RecordField Name="DateofScan" Type="Date" />
                                            </Fields>
                                        </ext:JsonReader>
                                    </Reader>
                                </ext:Store>
                            </Store>
                            <ColumnModel ID="ColumnModel2" runat="server">
                                <Columns>
                                    <ext:DateColumn ColumnID="DateofScan" Align="Left" DataIndex="DateofScan"
                                        MenuDisabled="true" Sortable="false" Groupable="false" Width="120" Format="yyyy-MM-dd HH:mm:ss" />
                                    <ext:Column ColumnID="Value" Align="Left" DataIndex="Value" MenuDisabled="true"
                                        Sortable="false" Groupable="false" Width="100" />
                                </Columns>
                            </ColumnModel>
                            <SelectionModel>
                                <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" SingleSelect="true">
                                </ext:RowSelectionModel>
                            </SelectionModel>
                            <BottomBar>
                                <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="30" StoreID="stSensorHistory"
                                    DisplayInfo="true" HideRefresh="true">
                                    <Plugins>
                                        <ext:SlidingPager ID="SlidingPager1" runat="server">
                                            <GetText Fn="function (s) {return 'View Page: '+ s.value}" />
                                        </ext:SlidingPager>
                                    </Plugins>
                                </ext:PagingToolbar>
                            </BottomBar>
                        </ext:GridPanel>
    And here I load the data into the store:

            [DirectMethod]
            public void LoadWindow_SensorDetails(int ID_Sensor)
            {
                this.stSensorHistory.DataSource = DataManager.GetSensorHistory(ID_Sensor);
                this.stSensorHistory.DataBind();
            }
    How can I solve this issue?

    Thanks for your help!

    Have a good day.
    Last edited by Daniil; May 12, 2015 at 7:06 PM. Reason: [CLOSED]
  2. #2
    Hi @John_Writers,

    Please provide a full test case as a standalone .aspx page. Please see Example (Very Helpful).
    Forum Guidelines For Posting New Topics
  3. #3

    Minimized example

    Hi,
    here a minimal running example:

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html>
    
    
    <script runat="server">
        [DirectMethod]
        public void LoadWindow_SensorDetails(int ID_Sensor)
        {
            this.stSensorHistory.DataSource = new object[]
                {
                    new { Value="Close", DateofScan="Apr 30 2015  4:26PM"},
                    new { Value="Close", DateofScan="Apr 30 2015  4:13PM"},
                    new { Value="Open", DateofScan="Apr 30 2015  4:12PM"},
                    new { Value="Open", DateofScan="Apr 30 2015  4:09PM"},
                    new { Value="Close", DateofScan="Apr 30 2015  4:09PM"},
                    new { Value="Close", DateofScan="Apr 30 2015  3:59PM"},
                    new { Value="Close", DateofScan="Apr 30 2015  3:55PM"},
                    new { Value="Open", DateofScan="Apr 30 2015  3:52PM"},
                    new { Value="Close", DateofScan="Apr 30 2015  3:40PM"},
                    new { Value="Open", DateofScan="Apr 30 2015  3:30PM"},
                    new { Value="Close", DateofScan="Apr 30 2015  3:25PM"},
                    new { Value="Close", DateofScan="Apr 30 2015  3:14PM"},
                    new { Value="Open", DateofScan="Apr 30 2015  3:13PM"},
                    new { Value="Close", DateofScan="Apr 30 2015  3:03PM"},
                    new { Value="Close", DateofScan="Apr 30 2015  2:56PM"},
                    new { Value="Close", DateofScan="Apr 30 2015  2:45PM"},
                    new { Value="Close", DateofScan="Apr 30 2015  2:34PM"},
                    new { Value="Open", DateofScan="Apr 30 2015  2:33PM"},
                    new { Value="Close", DateofScan="Apr 30 2015  2:30PM"},
                    new { Value="Close", DateofScan="Apr 30 2015  2:20PM"}
                };
    
    
            this.stSensorHistory.DataBind();
            tpDetails.SetActiveTab(0);
        }
    
    
    </script>
    
    
    <html>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="rm" runat="server" />
        <ext:Viewport ID="vpDefault" runat="server" Layout="BorderLayout">
           <Items>
           <ext:Button  runat="server" Text ="Click me" Region="Center">
               <Listeners>
                    <Click Handler="
                                    #{wndDetail_Sensor}.show();
                                    Ext.net.DirectMethods.LoadWindow_SensorDetails(29);" />
               </Listeners>
           </ext:Button>
           </Items>
        </ext:Viewport>
        <ext:Window ID="wndDetail_Sensor" runat="server" Icon="ApplicationViewDetail" Hidden="true" Width="640" Height="480" Modal="true" Layout="FitLayout">
            <Items>
                <ext:TabPanel ID="tpDetails" runat="server" ActiveTabIndex="0" Border="false">
                    <Items>
                        <ext:GridPanel ID="gpSensorHistory" runat="server" Title="History" EnableColumnMove="false" EnableColumnHide="false" EnableColumnResize="false" >
                            <Store>
                                <ext:Store ID="stSensorHistory" runat="server">
                                    <Reader>
                                        <ext:JsonReader>
                                            <Fields>
                                                <ext:RecordField Name="Value" Type="String" />
                                                <ext:RecordField Name="DateofScan" Type="String" />
                                            </Fields>
                                        </ext:JsonReader>
                                    </Reader>
                                </ext:Store>
                            </Store>
                            <ColumnModel ID="ColumnModel2" runat="server">
                                <Columns>
                                    <ext:Column ColumnID="DateofScan" Align="Left" DataIndex="DateofScan"
                                        MenuDisabled="true" Sortable="false" Groupable="false" Width="120" />
                                    <ext:Column ColumnID="Value" Align="Left" DataIndex="Value" MenuDisabled="true"
                                        Sortable="false" Groupable="false" Width="100" />
                                </Columns>
                            </ColumnModel>
                            <SelectionModel>
                                <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" SingleSelect="true">
                                </ext:RowSelectionModel>
                            </SelectionModel>
                            <BottomBar>
                                <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10" StoreID="stSensorHistory"
                                    DisplayInfo="true" HideRefresh="true">
                                    <Plugins>
                                        <ext:SlidingPager ID="SlidingPager1" runat="server">
                                            <GetText Fn="function (s) {return 'View Page: '+ s.value}" />
                                        </ext:SlidingPager>
                                    </Plugins>
                                </ext:PagingToolbar>
                            </BottomBar>
                        </ext:GridPanel>
                    </Items>
                </ext:TabPanel>
            </Items>
        </ext:Window>
    
    
        </form>
    </body>
    </html>
    Thank you for your help!
    Last edited by John_Writers; May 11, 2015 at 3:28 PM. Reason: wrong rendering!!!
  4. #4
    Thank you.

    It doesn't reproduce the issue for me. I see 10 records on the first page initially.

    Please clarify what Ext.NET version are you dealing with?

    I tested with the latest.
  5. #5
    This is the assembly version: 1.2.0.21133 compiled for .NET v2.0.50727.

    It's pretty old right?

    What could I do?

    Thanks
  6. #6
    Yes, it is quite on old version and yes, I was able to reproduce with that.

    As a workaround I could suggest:
    <Click Handler="#{wndDetail_Sensor}.show();
                    Ext.net.DirectMethods.LoadWindow_SensorDetails(29, {
                        success: function() {
                            PagingToolbar1.changePage(1);
                        }
                    });" />
    Though, we would highly recommend to update to the latest Ext.NET v1. Lots of bugs have been fixed since v1.2.
  7. #7
    Thanks,
    I upgraded to the version 1.7.

    Now I noticed everything running well and much way faster!

    Thanks,

    have a good day!

Similar Threads

  1. [CLOSED] gridpanel - PageSize property not working
    By PriceRightHTML5team in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 18, 2013, 3:07 AM
  2. Replies: 1
    Last Post: Sep 01, 2013, 3:29 PM
  3. Replies: 0
    Last Post: Jun 11, 2012, 2:59 AM
  4. Ext:PagingToolbar & ComboBox PageSize
    By cwolcott in forum 2.x Help
    Replies: 2
    Last Post: Mar 19, 2012, 9:55 PM
  5. Dynamically changing PagingToolBar's PageSize
    By r_honey in forum 1.x Help
    Replies: 8
    Last Post: Jan 22, 2009, 7:26 AM

Posting Permissions