[FIXED] [#1317] [4.5.0] Spreadsheet row number not working correctly when groupSummary enabled

  1. #1

    [FIXED] [#1317] [4.5.0] Spreadsheet row number not working correctly when groupSummary enabled

    Hi, Found row number not changing when grid has groupSummary enabled. Can reproduce with your demo code below.
    To reproduce: click next page, the row number does not increase. It works fine if GroupSummary feature is removed.
    Please help!
    Thanks
    -Szhang

    <%@ Page Language="C#" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Store1.DataSource = this.GetData();
            }
        }
    
        public List<object> GetData()
        {
            var data = new List<object>();
            var thisYear = DateTime.Today.Year;
            var random = new Random();
    
            for (int year = 1900; year <= thisYear; ++year)
            {
                data.Add(new object[]
                {
                    year,
                    this.GetRandomNumber(-10, 100, random),
                    this.GetRandomNumber(-10, 100, random),
                    this.GetRandomNumber(-10, 200, random),
                    this.GetRandomNumber(-10, 200, random),
                    this.GetRandomNumber(-10, 200, random),
                    this.GetRandomNumber(-10, 300, random),
                    this.GetRandomNumber(-10, 300, random),
                    this.GetRandomNumber(-10, 300, random),
                    this.GetRandomNumber(-10, 600, random),
                    this.GetRandomNumber(-10, 500, random),
                    this.GetRandomNumber(-10, 200, random),
                    this.GetRandomNumber(-10, 100, random)
                });
            }
    
            return data;
        }
    
        public int GetRandomNumber(int min, int max, Random r)
        {
            return (int)Math.Floor(r.NextDouble() * (max - min)) + min;
        }
    
        protected void ReloadData(object sender, DirectEventArgs e)
        {
            this.Store1.DataSource = this.GetData();
            this.Store1.DataBind();
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Spreadsheet Selection Model - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />
    
        
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:GridPanel
                runat="server"
                ColumnLines="true"
                Height="400"
                Width="775"
                Title="Spreadsheet"
                Frame="true">
                <Store>
                    <ext:Store ID="Store1" runat="server">
                        <Model>
                            <ext:Model runat="server" IDProperty="year" PageSize="3">
                                <Fields>
                                    <ext:ModelField Name="year" />
                                    <ext:ModelField Name="jan" />
                                    <ext:ModelField Name="feb" />
                                    <ext:ModelField Name="mar" />
                                    <ext:ModelField Name="apr" />
                                    <ext:ModelField Name="may" />
                                    <ext:ModelField Name="jun" />
                                    <ext:ModelField Name="jul" />
                                    <ext:ModelField Name="aug" />
                                    <ext:ModelField Name="sep" />
                                    <ext:ModelField Name="oct" />
                                    <ext:ModelField Name="nov" />
                                    <ext:ModelField Name="dec" />
                                </Fields>
                            </ext:Model>
                        </Model>
                        <Reader>
                            <ext:ArrayReader />
                        </Reader>
                    </ext:Store>
                </Store>
                <SelectionModel>
                    <ext:SpreadsheetSelectionModel
                        ID="SpreadsheetSelectionModel1"
                        runat="server"
                        RowSelect="true"
                        />
                </SelectionModel>
                <ColumnModel>
                    <Columns>
                        <ext:Column runat="server" Text="Year" DataIndex="year" Flex="1" MinWidth="70" />
                        <ext:Column runat="server" Text="Jan" DataIndex="jan" Width="50" />
                        <ext:Column runat="server" Text="Feb" DataIndex="feb" Width="50" />
                        <ext:Column runat="server" Text="Mar" DataIndex="mar" Width="50" />
                        <ext:Column runat="server" Text="Apr" DataIndex="apr" Width="50" />
                        <ext:Column runat="server" Text="May" DataIndex="may" Width="50" />
                        <ext:Column runat="server" Text="Jun" DataIndex="jun" Width="50" />
                        <ext:Column runat="server" Text="Jul" DataIndex="jul" Width="50" />
                        <ext:Column runat="server" Text="Aug" DataIndex="aug" Width="50" />
                        <ext:Column runat="server" Text="Sep" DataIndex="sep" Width="50" />
                        <ext:Column runat="server" Text="Oct" DataIndex="oct" Width="50" />
                        <ext:Column runat="server" Text="Nov" DataIndex="nov" Width="50" />
                        <ext:Column runat="server" Text="Dec" DataIndex="dec" Width="50" />
                    </Columns>
                </ColumnModel>
                <ViewConfig TrackOver="false" />
                <Tools>
                    <ext:Tool Type="Refresh" ToolTip="Reload Data" OnDirectClick="ReloadData" />
                </Tools>
                <BottomBar>
                    <ext:PagingToolbar runat="server"/>
                </BottomBar>
                 <Features>
                    <ext:GroupingSummary ShowSummaryRow="true"
                        runat="server"
                        GroupHeaderTplString='{columnName}: {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})' />
                </Features>
            </ext:GridPanel>
        </form>
    </body>
    </html>
    Last edited by fabricio.murta; Dec 20, 2017 at 12:44 PM.
  2. #2
    Any updates on this issue ?
    Thanks
    -szhang
  3. #3
    Hello Susan!

    Sorry for the long delay, we have your post in our sight, and we'll take a good look on what's up (if that's feasible or not) and provide you a better feedback. Please hold on a little longer, maybe the plug ins conflicting with the relatively new spreadsheet functionality.
    Fabrício Murta
    Developer & Support Expert
  4. #4
    Good to know. Thank you!
    -szhang
  5. #5
    Hello Susan!

    Well, it looks like this has been a bug for a while now, and we've been tracking it since 2016, Sencha didn't fix it thus far.

    Anyway, we didn't have a forum thread tied to the issue and now we've bound this thread to the it, so we're going to post an update here as soon as this problem gets fixed.

    Unfortunately, there's no simple workaround for this, currently.
    Fabrício Murta
    Developer & Support Expert
  6. #6
    Well, on a second thought, maybe there's a fix for this! We just applied the fix as we don't see Sencha fixing it on their own for the time being. Not due to the recent changes in Sencha company, but just because the issue has been sitting there for more than one year.

    We've just fixed the issue and it is promptly available if you fetch latest github sources. This fix will make part of the Ext.NET 4.5.1 release.

    Hope the news are welcome!
    Fabrício Murta
    Developer & Support Expert
  7. #7
    Hi Fabricio, Glad to know. But we are still on 4.2. Upgrade requires a full retest. Is there any patch can make it work for 4.2 ?
    Thanks
    -szhang
  8. #8
    Hello Susan!

    I'm afraid not. The version you are using is several steps behind the current one which implemented several features and bugfixes, we just can't guarantee a fix that works on 4.5.0 would work on 4.4.0 or any older. You may try, at your own risk, checking the diff from sources in github and trying to apply it on the version you are using. For convenience we keep a git tag on every Ext.NET release, so you can switch to the latest 4.2 tag, then apply or cherry-pick the fix, and rebuild Ext.NET with that.

    At least that's the best I can think of at the moment, unfortunately.
    Fabrício Murta
    Developer & Support Expert
  9. #9
    Thanks for your info! Please close this thread for now. I will check what I can do later.
    Thanks!
    -szhang

Similar Threads

  1. Replies: 15
    Last Post: Sep 07, 2016, 10:14 PM
  2. Replies: 4
    Last Post: May 13, 2016, 9:49 AM
  3. Replies: 3
    Last Post: Mar 24, 2016, 3:51 PM
  4. Replies: 7
    Last Post: Jun 23, 2015, 1:43 PM
  5. Replies: 0
    Last Post: Dec 02, 2010, 9:01 PM

Posting Permissions