GridView Pagination issue

  1. #1

    GridView Pagination issue

    Hi guys,

    So i have a gridview set up inside of a form panel with some text fields and buttons, but can't seem to get the pagination of the result set to work. I set PageSize = 20 and have the Paging Toolbar set up in the BottomBar, however the result set doesn't get paged out: it just displays to the bottom of the form and stops displaying anything else. Could you help me figure out what I'm missing? Here's my code:
                <ext:FormPanel ID="NYRollOffPanel" 
                    runat="server" 
                    Hidden="true"
                    Frame="true"
                    Height="475" Layout="AutoLayout" AutoHeight="true">
                    <Items>
                        <ext:Container ID="container1" runat="server" AnchorHorizontal="100%" Layout="HBoxLayout">
                            <Items>
                                <ext:TextField ID="tDCID" 
                                    runat="server"
                                    FieldLabel="DCID" 
                                    LabelWidth="40"
                                    MarginSpec="0 0 5 0">
                                </ext:TextField>
                                <ext:Button ID="btnGenerateNYRollOffs" 
                                    runat="server" 
                                    Text="Generate Report" 
                                    MarginSpec="0 0 5 5">
                                    <Listeners>
                                        <Click Handler="#{dsNYRollOff}.reload(); #{gpNYRollOffs}.setVisible(true);" />
                                    </Listeners>
                                </ext:Button>
                            </Items>
                        </ext:Container>
                        <ext:GridPanel ID="gpNYRollOffs" 
                            runat="server" 
                            width="512"
                            Buffered="true"
                            Hidden="true" 
                            Layout="AutoLayout">
                        <Store>
                            <ext:Store ID="dsNYRollOff" 
                                runat="server" 
                                PageSize="20"
                                AutoLoad="true">
                                <Model>
                                    <ext:Model ID="mdlMatrix1" runat="server" IDProperty="MAIDT">
                                        <Fields>
                                            <ext:ModelField Name="dealcapid" Type="Int" />
                                            <ext:ModelField Name="CustomerNumber" Type="Int" />
                                            <ext:ModelField Name="RateID" Type="Int" />
                                            <ext:ModelField Name="Matrix" Type="Int" />
                                            <ext:ModelField Name="BillingType" Type="String" />
                                        </Fields>
                                    </ext:Model>
                                </Model>
                                <Proxy>
                                    <ext:AjaxProxy Url="/Operations/GetNYRollOffs/" Timeout="1200000">
                                        <ActionMethods Read="POST" />
                                        <Reader>
                                            <ext:JsonReader Root="data" TotalProperty="total" />
                                        </Reader>
                                    </ext:AjaxProxy>
                                </Proxy>              
                                <Parameters>
                                    <ext:StoreParameter Name="dcid" Value="#{tDCID}.getValue()" Mode="Raw" />
                                </Parameters>
                            </ext:Store>
                        </Store>
                        <ColumnModel ID="ColumnModel1" runat="server">
                            <Columns>
                                <ext:Column ID="DCID" runat="server" DataIndex="dealcapid" Text="DCID" Width="50" />
                                <ext:Column ID="ColumnCustomerNumber" runat="server" DataIndex="CustomerNumber" Text="Customer Number" Width="150" />
                                <ext:Column ID="ColumnRateID" runat="server" DataIndex="RateID" Text="Rate ID" Width="150"  />
                                <ext:Column ID="ColumnMatrix" runat="server" DataIndex="Matrix" Text="Matrix" Width="60" />
                                <ext:Column ID="ColumnBillingType" runat="server" DataIndex="BillingType" Text="Billing Type" Width="100" />
                            </Columns>
                        </ColumnModel>
                        <SelectionModel>
                            <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" Mode="Single" />
                        </SelectionModel>
                        <View>
                            <ext:GridView ID="GridView1" runat="server" />
                        </View>
                        <BottomBar>
                            <ext:PagingToolbar ID="PagingToolbar1" AutoHeight="true" Frame="true"
                                HideRefresh="true"
                                runat="server"       
                                DisplayInfo="true" 
                                DisplayMsg="Displaying rows {0} - {1} of {2}" 
                                EmptyMsg="No rows to display">
                                <Items>
                                    <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server" />
                                    <ext:Button ID="btnExportPortal" runat="server" Text="To Excel" Icon="PageExcel">
                                        <DirectEvents>
                                            <Click Url="/Operations/ExportToExcel" IsUpload="true" />
                                        </DirectEvents>
                                    </ext:Button>                                                
                                </Items>
                            </ext:PagingToolbar>
                        </BottomBar>
                        </ext:GridPanel>
                    </Items>
                    <Listeners>
                    </Listeners>
                </ext:FormPanel>
  2. #2
    Hi @navalurzu7,

    Please clarify do you handle start, limit and/or page in /Operations/GetNYRollOffs/?

    An example of handling is here:
    http://mvc.ext.net/#/GridPanel_Pagin...Sorting/Remote
  3. #3
    Daniil,

    I don't handle any of those 3 events inside of /GetNYRollOffs, no...I tried looking at the source code via the link you sent me, however i get an http 500 error trying to view it:Click image for larger version. 

Name:	500error.jpg 
Views:	118 
Size:	90.6 KB 
ID:	24222.
    What are the start/limit/page functions and how would i implement them to fix this paging issue?
  4. #4
    Please open the sample in a bit different way. Follow this link:
    http://mvc.ext.net

    Then open GridPanel => Paging and Sorting => Remote.

    Source Code is opened well in such a case.

    What are the start/limit/page functions and how would i implement them to fix this paging issue?
    They are not events, but the parameters which are sent by AjaxProxy with a request to server. You should return data for a requested page only. Initially, there is the first page shown in a PagingToolbar. So, you should return data from server for the first page only. If a user switches to the second page then you should return data from server for the second page only. It is called remote paging. Please investigate the example.

    Though, why did I assume that you need remote paging? Maybe, you don't need it and local is okay for you? If yes, please set RemotePaging="false" for the Store.
  5. #5
    Daniil,

    Manually setting RemotePaging to false for the store, as well as setting PageSize worked! Originally i had either had RemotePaging set to True or had not referenced it at all. Manually setting it to false though forced it to adhere to the PageSize limit and things look good now.

    Thanks for you help!

Similar Threads

  1. GridPanel Pagination Issue
    By anulall in forum 1.x Help
    Replies: 3
    Last Post: Aug 09, 2011, 9:53 AM
  2. [CLOSED] Gridview Issue
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 24, 2010, 11:10 AM
  3. [CLOSED] Gridview scrollbar issue
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Aug 08, 2010, 5:22 PM
  4. GridView Header Issue in IE 6.0
    By prasso in forum 1.x Help
    Replies: 0
    Last Post: Dec 17, 2009, 3:15 PM
  5. [CLOSED] pagination issue
    By alexp in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 20, 2009, 1:19 PM

Tags for this Thread

Posting Permissions