[FIXED] [#204] [2.2] RowNumberer resets to 1 when you page

  1. #1

    [FIXED] [#204] [2.2] RowNumberer resets to 1 when you page

    When you have remote paging on, RowNumberer resets to 1 when you change page. Pretty sure this wasn't the case in 1.x

    <script runat="server">
      
        
        Private Sub Store1_ReadData(sender As Object, e As Ext.Net.StoreReadDataEventArgs) Handles Store1.ReadData
            Dim list = New List(Of NewObj)()
          
            Dim startIndex = e.Page * e.Limit - e.Limit + 1
            Dim endIndex = startIndex + e.Limit - 1
                 
            For index = startIndex To endIndex
                Dim obj = New NewObj()
                obj.Name = "Item " + index.ToString()
                obj.ID = index
                list.Add(obj)
            Next
    
    
            e.Total = 100
            
            Me.Store1.DataSource = list
            Me.Store1.DataBind()
        End Sub
        
        Class NewObj
            
            Private _ID As Integer
            Public Property ID() As Integer
                Get
                    Return _ID
                End Get
                Set(ByVal value As Integer)
                    _ID = value
                End Set
            End Property
    
    
            
            Private _Name As String
            Public Property Name() As String
                Get
                    Return _Name
                End Get
                Set(ByVal value As String)
                    _Name = value
                End Set
            End Property
    
    
        End Class
    </script>
    <!DOCTYPE html>
    <html>
    <head id="Head1" runat="server">
        <title>Test Page </title>
    </head>
    <body>
      
        <form id="Form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" ScriptMode="Debug" Theme="Gray"
            DisableViewState="true" />
        <ext:Window runat="server" Width="500" Height="500" Layout="FitLayout">
            <Items>
                <ext:GridPanel ID="GridPanel1" runat="server" Title="ComponentColumn Editor" Width="600"
                    Height="300">
                    <Store>
                        <ext:Store ID="Store1" runat="server" AutoLoad="true" PageSize="25">
                            <Proxy>
                                <ext:PageProxy />
                            </Proxy>
                            <Model>
                                <ext:Model ID="Model1" runat="server">
                                    <Fields>
                                        <ext:ModelField Name="Name" Type="String" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel ID="ColumnModel1" runat="server">
                        <Columns>
                            <ext:RowNumbererColumn runat="server">
                            </ext:RowNumbererColumn>
                            <ext:Column DataIndex="Name" Text="Name">
                            </ext:Column>
                        </Columns>
                    </ColumnModel>
                    <BottomBar>
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server" DisplayInfo="true" DisplayMsg="Displaying employees {0} - {1} of {2}"
                            EmptyMsg="No employees to display" />
                    </BottomBar>
                </ext:GridPanel>
            </Items>
        </ext:Window>
        </form>
    </body>
    </html>
    Last edited by Daniil; Apr 27, 2016 at 12:23 PM.
  2. #2
    For anyone looking for an override, this shuld work:

    // Override rownumberer to show correct numbers when paging
    Ext.grid.RowNumberer.override({
        renderer: function (value, metaData, record, rowIdx, colIdx, store) {
            var rowspan = this.rowspan;
            if (rowspan) {
                metaData.tdAttr = 'rowspan="' + rowspan + '"';
            }
    
    
            metaData.tdCls = Ext.baseCSSPrefix + 'grid-cell-special';
            var options = store.lastOptions;
            return ((options && options.start) ? options.start : 0) + rowIdx + 1;
        }
    });
  3. #3
    Hello!

    It's a known bug. Thank you for overriding!

    We created issue to track: https://github.com/extnet/Ext.NET/issues/204
  4. #4
    Fixed in the revision #5027. It will go to the upcoming v2.2 release.

    We will need to remove the fix when Sencha fixes it itself.
  5. #5
    Quote Originally Posted by Daniil View Post
    Fixed in the revision #5027. It will go to the upcoming v2.2 release.

    We will need to remove the fix when Sencha fixes it itself.
    Was this fixed or was the override not removed? Or perhaps not fully fixed?

    The RowNumbererColumn() works fine for the first load of a store, but I've noticed it acting poorly once you reload data into the store via store.loadData().
  6. #6
    Quote Originally Posted by dangerlinto View Post
    Was this fixed or was the override not removed? Or perhaps not fully fixed?

    The RowNumbererColumn() works fine for the first load of a store, but I've noticed it acting poorly once you reload data into the store via store.loadData().
    Sencha has not fixed it yet. We applied our own fix. About the loadData issue, could you provide a sample to reproduce?

Similar Threads

  1. Replies: 0
    Last Post: Dec 25, 2012, 2:03 AM
  2. Replies: 13
    Last Post: Nov 10, 2011, 1:26 PM
  3. [CLOSED] ComboBox value resets after typeAhead does not return a match
    By joeRobee in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Jan 06, 2011, 2:54 PM
  4. [CLOSED] [1.0] MultiCombo resets store on load
    By danielg in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 06, 2010, 7:48 AM
  5. Replies: 5
    Last Post: Aug 04, 2009, 10:49 AM

Posting Permissions