[FIXED] [#1530] [4.4.0] LockedColumns with RowExpander

  1. #1

    [FIXED] [#1530] [4.4.0] LockedColumns with RowExpander

    I'm getting a javascript error trying to load a grid with Locked columns and the RowExpander plugin. Please see the following example:

    <%@ Page Language="C#" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.GridPanel1.Store.Primary.DataSource = new object[]
                {
                    new object[] { "3m Co", 71.72, 0.02, 0.03, "9/1 12:00am" },
                    new object[] { "Alcoa Inc", 29.01, 0.42, 1.47, "9/1 12:00am" },
                    new object[] { "Altria Group Inc", 83.81, 0.28, 0.34, "9/1 12:00am" },
                    new object[] { "American Express Company", 52.55, 0.01, 0.02, "9/1 12:00am" },
                    new object[] { "American International Group, Inc.", 64.13, 0.31, 0.49, "9/1 12:00am" }
                };
    
                this.GridPanel1.Store.Primary.DataBind();
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>GridPanel with Locking Columns - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />
    
        <script>
            var template = '<span style="color:{0};">{1}</span>';
    
            var change = function (value) {
                return Ext.String.format(template, (value > 0) ? "green" : "red", value);
            };
    
            var pctChange = function (value) {
                return Ext.String.format(template, (value > 0) ? "green" : "red", value + "%");
            };
        </script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
    
        <h1>GridPanel with Locking Columns</h1>
    
        <p>This example shows how to achieve "freeze pane" locking functionality similar to Excel.</p>
        <p>Columns may be locked or unlocked by dragging them across into the opposite side, or by using the column's header menu.</p>
        <p>The "Price" column is not lockable, and may not be dragged into the locked side, or locked using the header menu.</p>
        <p>It is not possible to lock <i>all</i> columns using the user interface. The unlocked side must always contain at least one column.</p>
    
        <ext:GridPanel
            ID="GridPanel1"
            runat="server"
            Title="Locking Grid"
            Width="600"
            Height="350">
            <Store>
                <ext:Store runat="server">
                    <Model>
                        <ext:Model runat="server">
                            <Fields>
                                <ext:ModelField Name="company" />
                                <ext:ModelField Name="price" Type="Float" />
                                <ext:ModelField Name="change" Type="Float" />
                                <ext:ModelField Name="pctChange" Type="Float" />
                                <ext:ModelField Name="lastChange" Type="Date" DateFormat="M/d hh:mmtt" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel>
                <Columns>
                    <ext:RowNumbererColumn runat="server" />
                    <ext:Column runat="server" Text="Company<br>Name" DataIndex="company" Width="200" Locked="true" Sortable="false" />
                    <ext:Column runat="server" Text="Price" DataIndex="price" Width="125" Lockable="false">
                        <Renderer Format="UsMoney" />
                    </ext:Column>
                    <ext:Column runat="server" Text="Change" DataIndex="change" Width="125">
                        <Renderer Fn="change" />
                    </ext:Column>
                    <ext:Column runat="server" Text="% Change" DataIndex="pctChange" Width="125">
                        <Renderer Fn="pctChange" />
                    </ext:Column>
                    <ext:DateColumn runat="server" Text="Last Updated" DataIndex="lastChange" Width="135"/>
                </Columns>
            </ColumnModel>
            <Plugins>
                <ext:RowExpander>
                    <Template runat="server">
                        <Html>
                            test
                        </Html>
                    </Template>
                </ext:RowExpander>
            </Plugins>
        </ext:GridPanel>
    </body>
    </html>
    Last edited by fabricio.murta; Aug 24, 2017 at 5:25 PM.
  2. #2
    Hello @tylert!

    Thanks for the test case and report, we could reproduce it and the fix is in place, becoming available on the next Ext.NET release we are preparing, 4.4.0.

    The release will be out in the next few weeks if all goes well, so, are you willing to wait until 4.4.0 is out, or do you need it working for the time being?

    It's amazing how a tiny typo survived 2 years, 11 months and 10 days in the code! But the workaround will require a whole method being overridden so, if feasible for you, we'd suggest you to hold on this one until next release or grab it from github.

    About grabbing the fix directly from github, if you're on development for unstable/new features, just get Ext.NET sources from the GitHub repository, branch ExtJS_651, so that you can see for yourself the feature fixed. We already submitted the branch to the Examples Explorer and no issue raised initially, so you should be safe to try it. We just don't recommend publishing your product using this unstable branch to production environment until it gets merged in to the stable stream in github (master branch).

    For the record, the issue attached to this bug is #1530 and it has already been fixed in sources, becoming publicly available next release, which at the moment is expected to be 4.4.0.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thanks -- this fix works well for the original example. However, if I turn on SingleExpand=true, then the rowexpander doesn't behave correctly. It is slow to expand the row and then it changes the icons of all of the other rows as being expanded. Let me know if you are not able to recreate this bug.

    Unfortunately I need to use SingleExpand because when it's not on my grid is very slow when it has a large number of records.
  4. #4
    Hello @tylert!

    I see!.. Thanks for testing on your side! I guess that "if" block in the part of the code of the row expander has not been used for quite a while. It shouldn't be hard to tackle. We'll reopen the issue to fix that as well.
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Hello again @tylert!

    As this other issue was tightly related to row expander using locking grid, we didn't need to create a new issue at all, just bundled the fix on the same. And just pushed them to github. We can keep this open for some days for you to test and give your feedback, but we're confident the fix is now final.

    If anything, I noticed row numberer leaves its white background over the row selection and looks a little odd when you expand the row. As for that, I'm afraid this is a theme issue (Triton, to be specific), and should be addressed with this simple CSS override:

    .x-grid-cell-row-numberer {
        background-color: transparent;
    }
    Fabrício Murta
    Developer & Support Expert
  6. #6
    This works for well for us so far in testing. Thanks!
  7. #7
    Hello @tylert!

    Glad it now looks good for you! No matter how deep we try to go into a fixed feature's side effects, there's always something that can break on the other side!

    We'll be marking this as fixed now, then. I believe anything new with RowExpander would fit either a feature request or different/unrelated bug now.

    Thank you very much for the invaluable feedback you're providing us with!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 0
    Last Post: Jul 21, 2015, 6:26 AM
  2. Replies: 2
    Last Post: Mar 18, 2014, 4:25 PM
  3. [FIXED] [V0.7] RowExpander Exception
    By Timothy in forum Bugs
    Replies: 2
    Last Post: Nov 05, 2008, 9:48 AM
  4. Replies: 1
    Last Post: Oct 13, 2008, 6:16 PM
  5. [FIXED] [V0.7.0] RowExpander Bug
    By Timothy in forum Bugs
    Replies: 2
    Last Post: Oct 13, 2008, 2:25 PM

Posting Permissions