[OPEN] [#278] Hidden column editor cause java error

  1. #1

    [OPEN] [#278] Hidden column editor cause java error

    Hello,

    When a component column of a grid is hidden during page load, it causes javascript error @ the second item mouse over. If the column is not hidden during page load but than hidden @client side, no problem occurs. Please investigate the sample code below. Just run and move mouse over the rows.


    Update: The same error applies to ext:Column editor as well. Sample code-2 attached.

    Component Sample:
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Store1.Data = new object[]
                {
                    new object[] { 0, "Item1" },
                    new object[] { 1, "Item2" },
                    new object[] { 2, "Item3" },
                    new object[] { 3, "Item2" },
                    new object[] { 4, "Item4" }
                };
            }
        }
    </script>
     
    <!DOCTYPE html>
     
    <html>
    <head id="Head1" runat="server">
        <title>Multiple Editors - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" /> 
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
             
            <h1>Multiple Editors</h1>        
     
            <ext:GridPanel ID="GridPanel1"
                runat="server"
                Title="Hidden component column"
                Width="400"
                Height="180">
                <Store>
                    <ext:Store ID="Store1" runat="server">
                        <Model>
                            <ext:Model ID="Model1" runat="server">
                                <Fields>
                                    <ext:ModelField Name="Index" Type="Int" />
                                    <ext:ModelField Name="Value"/>
                                </Fields>
                            </ext:Model>
                        </Model>
                        <Reader>
                            <ext:ArrayReader />
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel ID="ColumnModel1" runat="server">
                    <Columns>
                         <ext:RowNumbererColumn ID="RowNumbererColumn1" runat="server" />
     
                         <ext:ComponentColumn ID="ComponentColumn1" runat="server" Flex="1" Editor="true" OverOnly="true" DataIndex="Value">
                            <Component>
                                <ext:ComboBox ID="ComboBox1" runat="server">
                                    <Items>
                                        <ext:ListItem Text="Item1" />
                                        <ext:ListItem Text="Item2" />
                                        <ext:ListItem Text="Item3" />
                                    </Items>
                                </ext:ComboBox>
                            </Component>
                            <Renderer Handler="return value;" />
                        </ext:ComponentColumn>
                        <ext:ComponentColumn ID="ComponentColumn2" runat="server" Width="25" PinAllColumns="false" AutoWidthComponent="false" OverOnly="true" Hidden="true" Hideable="true">
                            <Component>
                                <ext:Button ID="Button1" runat="server" ToolTip="Edit" Icon="Pencil" AllowDepress="true" EnableToggle="false">
                                </ext:Button>
                            </Component>
                        </ext:ComponentColumn>
                    </Columns>
                </ColumnModel>
            </ext:GridPanel>           
        </form>
    </body>
    </html>
    The problem occurs in below code line. this.overComponent.column is undefined.

    this.fireEvent("unbind", this, this.overComponent, this.overComponent.record, this.overComponent.column.index, this.grid);

    ext:Column sample (Click Show Comments button than double click any comment to start edit):

    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Store1.Data = new object[]
                {
                    new object[] { "Bond", "Com1" },
                    new object[] { "James Bond", "Com2" },
                    new object[] { "Jr. Bond", "Com3" },
                    new object[] { "Bond Jr.", "Com4" },
                };
            }
        }
    </script>
     
    <!DOCTYPE html>
     
    <html>
    <head id="Head1" runat="server">
        <title>Multiple Editors - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" /> 
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
             
            <h1>Multiple Editors</h1>        
     
            <ext:GridPanel ID="GridPanel1"
                runat="server"
                Title="Hidden component column"
                Width="600"
                Height="180">
                <Buttons>
                    <ext:Button runat="server" Text="Show Comments">
                        <Listeners>
                            <Click Handler="App.Comments.show()"></Click>
                        </Listeners>
                    </ext:Button>
                </Buttons>
                <Store>
                    <ext:Store ID="Store1" runat="server">
                        <Model>
                            <ext:Model ID="Model1" runat="server">
                                <Fields>
                                    <ext:ModelField Name="Name"/>
                                    <ext:ModelField Name="Comments"/>
                                </Fields>
                            </ext:Model>
                        </Model>
                        <Reader>
                            <ext:ArrayReader />
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel ID="ColumnModel1" runat="server">
                    <Columns>
                        <ext:RowNumbererColumn ID="RowNumbererColumn1" runat="server" />
                        <ext:Column ID="Name" runat="server" Text="Name" DataIndex="Name" Flex="1" ></ext:Column> 
                        <ext:Column ID="Comments" runat="server" Text="Comments" DataIndex="Comments" Flex="1" Hidden="true">
                            <Editor>
                                <ext:TextArea ID="CommentsEditor" runat="server" Height="200">
                                </ext:TextArea>
                            </Editor>
                        </ext:Column>  
                    </Columns>
                </ColumnModel>
                <Plugins>
                    <ext:CellEditing runat="server">
                    </ext:CellEditing>
                </Plugins>   
            </ext:GridPanel>           
        </form>
    </body>
    </html>

    The problem occurs in below code line. JavaScript runtime error: Object doesn't support property or method 'getEditor'

    if (columnHeader && !columnHeader.getEditor(record)) {
                    return false;
                }
    Thanks.
    Last edited by Baidaly; Jun 20, 2013 at 12:41 AM. Reason: [OPEN] [#278]
  2. #2
    Hi @bayoglu,

    The first issue has been fixed in SVN.

    The second one seems to be an ExtJS bug. We need a bit more time to check.
  3. #3
    Thanks @Daniil, waiting for the second issue. I am sure you will get over it quickly. Well the fact is that, when you say error is @ ExtJS, I strongly hope there is a workaround without waiting ExtJS response (;
  4. #4
    Reported to Sencha.
    http://www.sencha.com/forum/showthread.php?266237

    Sure, we will try to come up with a fix/workaround for you.
  5. #5
    The second issue is fixed in SVN (revision #5211), please update and retest
    Last edited by Daniil; Mar 18, 2014 at 4:27 PM.
  6. #6
    Both issues are solved, many thanks for quick response. Please mark as closed.
  7. #7
    Hello!

    Sencha has opened a bug.

    We have created an issue to track this defect: https://github.com/extnet/Ext.NET/issues/278

Similar Threads

  1. [CLOSED] java script error
    By elke.schreiber in forum 2.x Legacy Premium Help
    Replies: 11
    Last Post: May 13, 2013, 2:19 PM
  2. Replies: 4
    Last Post: Mar 02, 2013, 8:04 AM
  3. Replies: 8
    Last Post: Feb 06, 2013, 6:27 PM
  4. [CLOSED] Radio component inside window hidden=true
    By jeybonnet in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 10, 2010, 8:52 PM
  5. Replies: 2
    Last Post: Apr 01, 2010, 1:53 PM

Posting Permissions