[CLOSED] GridView wrong number of records displayed

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] GridView wrong number of records displayed

    I have a page set up like this:

        <asp:ObjectDataSource ID="dsUserVisits" runat="server" SelectMethod="GetUserVisits" TypeName="Access" OnSelected="dsUserVisits_Selected">
            <SelectParameters>
                <asp:Parameter Name="Start" Type="Int32" DefaultValue="0" />
                <asp:Parameter Name="Limit" Type="Int32" DefaultValue="100" />
                <asp:Parameter Name="SortField" />
                <asp:Parameter Name="SortDir" />
                <asp:Parameter Name="count" Direction="Output" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
    
        <ext:Store ID="sUserVisits" runat="server" AutoLoad="true" RemoteSort="true" DataSourceID="dsUserVisits" OnRefreshData="sUserVisits_RefreshData">
            <AutoLoadParams>
                <ext:Parameter Name="start" Value="={0}" />
                <ext:Parameter Name="limit" Value="={100}" />
            </AutoLoadParams>
                
            <Proxy>
                <ext:DataSourceProxy />
            </Proxy>
    
            <Reader>
                <ext:JsonReader ReaderID="ID">
                    <Fields>
                        <ext:RecordField Name="UserName" />
                        <ext:RecordField Name="Customer" />
                        <ext:RecordField Name="Visits" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
    
        <asp:ObjectDataSource ID="dsIpVisits" runat="server" SelectMethod="GetIpVisits" TypeName="Access" OnSelected="dsIpVisits_Selected">
            <SelectParameters>
                <asp:Parameter Name="Start" Type="Int32" DefaultValue="0" />
                <asp:Parameter Name="Limit" Type="Int32" DefaultValue="100" />
                <asp:Parameter Name="SortField" />
                <asp:Parameter Name="SortDir" />
                <asp:Parameter Name="count" Direction="Output" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
    
        <ext:Store ID="sIpVisits" runat="server" AutoLoad="true" RemoteSort="true" DataSourceID="dsIpVisits" OnRefreshData="sIpVisits_RefreshData">
            <AutoLoadParams>
                <ext:Parameter Name="start" Value="={0}" />
                <ext:Parameter Name="limit" Value="={100}" />
            </AutoLoadParams>
                
            <Proxy>
                <ext:DataSourceProxy />
            </Proxy>
    
            <Reader>
                <ext:JsonReader ReaderID="ID">
                    <Fields>
                        <ext:RecordField Name="IpAddress" />
                        <ext:RecordField Name="UserName" />
                        <ext:RecordField Name="Customer" />
                        <ext:RecordField Name="Visits" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
    
    <ext:BorderLayout runat="server">
        <North MarginsSummary="0 0 0 0">
            <ext:Panel runat="server" Height="300" Border="false">
                <Body>
                    <ext:ColumnLayout runat="server" Margin="5" FitHeight="true">
                        <ext:LayoutColumn ColumnWidth=".5">
                            <ext:GridPanel runat="server" ID="gridUserVisits" Height="300" StoreID="sUserVisits" Title="#Visits per User#">
                                <ColumnModel runat="server">
                                    <Columns>
                                        <ext:Column ColumnID="UserName" DataIndex="UserName" Header="#User Name#" />
                                        <ext:Column ColumnID="Customer" DataIndex="Customer" Header="#Customer#" />
                                        <ext:Column ColumnID="Visits" DataIndex="Visits" Header="#Visits#" />
                                    </Columns>
                                </ColumnModel>
    
                                <BottomBar>
                                    <ext:PagingToolBar ID="UserVisitsPagination" runat="server" StoreID="sUserVisits" PageSize="100" DisplayMsg="#Displaying {0} - {1} of {2}#"
                                        FirstText="#First Page#" PrevText="#Previous Page#" NextText="#Next Page#" LastText="#Last Page#" RefreshText="#Refresh#" >
                                        <Plugins>
                                            <ext:SlidingPager runat="server">
                                                <GetText Fn="function(s){return s.value}" />
                                            </ext:SlidingPager>
                                        </Plugins>
                                    </ext:PagingToolBar>
                                </BottomBar>
                                
                                <LoadMask ShowMask="true" Msg="#Loading...#" />
                            </ext:GridPanel>
                        </ext:LayoutColumn>
                        <ext:LayoutColumn ColumnWidth=".5">
                            <ext:GridPanel runat="server" ID="gridIpVisits" Height="300" StoreID="sIpVisits" Title="#Visits per Ip#">
                                <ColumnModel runat="server">
                                    <Columns>
                                        <ext:Column ColumnID="IpAddress" DataIndex="IpAddress" Header="#Ip Address#" />
                                        <ext:Column ColumnID="UserName" DataIndex="UserName" Header="#User Name#" />
                                        <ext:Column ColumnID="Customer" DataIndex="Customer" Header="#Customer#" />
                                        <ext:Column ColumnID="Visits" DataIndex="Visits" Header="#Visits#" />
                                    </Columns>
                                </ColumnModel>
    
                                <BottomBar>
                                    <ext:PagingToolBar ID="IpVisitsPagination" runat="server" StoreID="sIpVisits" PageSize="100" DisplayMsg="#Displaying {0} - {1} of {2}#"
                                        FirstText="#First Page#" PrevText="#Previous Page#" NextText="#Next Page#" LastText="#Last Page#" RefreshText="#Refresh#" >
                                        <Plugins>
                                            <ext:SlidingPager runat="server">
                                                <GetText Fn="function(s){return s.value}" />
                                            </ext:SlidingPager>
                                        </Plugins>
                                    </ext:PagingToolBar>
                                </BottomBar>
                                
                                <LoadMask ShowMask="true" Msg="#Loading...#" />
                            </ext:GridPanel>
                        </ext:LayoutColumn>
                    </ext:ColumnLayout>
                </Body>
            </ext:Panel>
        </North>
        <Center MarginsSummary="5 0 0 0">
            <ext:Panel runat="server" Height="300">
                <Body>
                </Body>
            </ext:Panel>
        </Center>
    </ext:BorderLayout>
    the GetUserVisits method returns 11 records and the GetIpVisits method returns 27 records
    both grids have the PageSize set to 100 but both display 11 records.
    The first one says: Displaying 1 - 11 of 11
    and the second one: Displaying 1 - 11 of 27

    and none of them shows multiple pages.
    I checked and the two methods return proper data from the DB, including the out int count param.
    So, I guess somewhere along the way the two params are confused.

  2. #2

    RE: [CLOSED] GridView wrong number of records displayed

    Hi,

    Can you show full sample code which we can test?
    The following sample has same functionality and works correctly

    https://examples1.ext.net/#/GridPane...g_and_Sorting/


    So, we need test your example to figure out the source of problem

  3. #3

    RE: [CLOSED] GridView wrong number of records displayed

    Hi, I found the problem with this one, sorry for not posting before.

    The problem was that the field I used for the ReaderID on the second grid was not unique. So all records that would have the same ReaderID would collapse to one entry.


    I don't know if this is expected behaviour but it is a bit confusing because the total count is the number of all records while less are displayed.
  4. #4

    RE: [CLOSED] GridView wrong number of records displayed

    Hi,

    Thanks for the update. We will try to reproduce it (none unique ReaderID)

Similar Threads

  1. Replies: 1
    Last Post: Jan 08, 2012, 5:10 AM
  2. Replies: 1
    Last Post: Jan 05, 2012, 2:16 PM
  3. Replies: 2
    Last Post: Sep 26, 2011, 10:23 AM
  4. Replies: 5
    Last Post: Jun 14, 2011, 11:47 AM
  5. Replies: 4
    Last Post: May 14, 2010, 2:29 PM

Posting Permissions