[FIXED] [#931] [3.3] ItemMouseDown gives null columns

  1. #1

    [FIXED] [#931] [3.3] ItemMouseDown gives null columns

    Support,

    This is a boundary condition defect.

    1. Load example.
    2. Now look at the screenshot. I highlighted a red box. Notice that the ColumnLine and the Row Line intersect at this point. Go ahead and click 10-20 times and try to get the exact intersection of the column and row lines.
    3. Review the console as you click and you will notice that it is possible to get a NULL for the e.position.column. This should NEVER be the case. if we are on the line, it should be the column to the right and my test case is a middle column.

    Please review and fix as i receive random complaints from my clients of a window failing to load and this is the cause.

    Thanks,
    /Z



    <%@ Page Language="C#" %>
    
    
    <%@ Import Namespace="System.Collections.Generic" %>
    
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
         {
             this.Store1.DataSource = new List<Project> 
             { 
                new Project(100, "Ext Forms: Field Anchoring", 1, "Integrate 2.0 Forms with 2.0 Layouts", 6, 150, 0, new DateTime(2007, 06, 24)),
                new Project(100, "Ext Forms: Field Anchoring", 2, "Implement AnchorLayout", 4, 150, 0, new DateTime(2007, 06, 25)),
                new Project(100, "Ext Forms: Field Anchoring", 3, "Add support for multiple types of anchors", 4, 150, 0, new DateTime(2007, 06, 27)),
                new Project(100, "Ext Forms: Field Anchoring", 4, "Testing and debugging", 8, 0, 0, new DateTime(2007, 06, 29)),
                new Project(100, "Ext Forms: Field Anchoring", 5, "Integrate 2.0 Forms with 2.0 Layouts", 6, 150, 0, new DateTime(2007, 06, 24)),
                new Project(100, "Ext Forms: Field Anchoring", 6, "Implement AnchorLayout", 4, 150, 0, new DateTime(2007, 06, 25)),
                new Project(100, "Ext Forms: Field Anchoring", 7, "Add support for multiple types of anchors", 4, 150, 0, new DateTime(2007, 06, 27)),
             };
    
    
            this.Store1.DataBind();
        }
    
    
        public class Project
        {
            public Project(int projectId, string name, int taskId, string description, int estimate, double rate, double cost, DateTime due)
            {
                this.ProjectID = projectId;
                this.Name = name;
                this.TaskID = taskId;
                this.Description = description;
                this.Estimate = estimate;
                this.Rate = rate;
                this.Due = due;
            }
    
    
            public int ProjectID { get; set; }
            public string Name { get;set; }
            public int TaskID { get; set; }
            public string Description { get;set; }
            public int Estimate { get;set; }
            public double Rate { get; set; }
            public double Cost { get; set; }
            public DateTime Due { get; set; }
        }
    </script>
    
    
    <!DOCTYPE html>
    
    
    <html>
    <head id="Head1" runat="server">
        <title>Menu bug</title>
        
        <script>
            var loadCombo = function () {
                var ctl = App.testssdsdf;
                var data = [];
                data.push({ id: 1, dates: "Some Data 1" });
                data.push({ id: 2, dates: "Some Data 2" });
                data.push({ id: 3, dates: "Some Data 3" });
                data.push({ id: 4, dates: "Some Data 4" });
                data.push({ id: 5, dates: "Some Data 5" });
    
    
                ctl.getStore().loadData(data);
            }
    
    
            var saveMouseDown = function (grid, record, item, index, e, eOpts) {
                if (e.button == 0) {    //left button
                    console.log( e.position.column==null);
                }
            };
    
    
        </script>
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server">        
    
    
            </ext:ResourceManager>
            
            <h1>Menu overflow bug</h1>
    
    
            <ext:Viewport runat="server" Layout="FitLayout">
                <Items>
                    <ext:GridPanel 
                        ID="GridPanel1" 
                        runat="server" 
                        Title="Test"       
                        ColumnLines="true"                  
                        Layout="FitLayout">
                        <TopBar>
                            <ext:Toolbar  ID="Toolbar1" runat="server" EnableOverflow="true" >
                                <Items>
    
    
                                    <ext:Button ID="ButtonPrevious1" runat="server"  Icon="Tux"> 
                                        <Listeners>
                                            <Click Handler="loadCombo();" />
                                        </Listeners>
                                    </ext:Button>
    
    
                                    <ext:ToolbarSeparator Hidden="true" ID="SingleSeparator" />
    
    
                                    <ext:ComboBox ID="test" 
                                            QueryMode="Local"
                                            ForceSelection="true"
                                            TriggerAction="All"
                                            EmptyText="Select an ..."
                                            DisplayField="text"
                                            ValueField="id"
                                            runat="server" 
                                            Width="350" >
    
    
                                    </ext:ComboBox>
    
    
                                    <ext:Button ID="ButtonNext" runat="server" Icon="ResultsetNext">
                                        <Listeners>
                                            <Click Handler="App.GridPanel1.getSelectionModel().deselectAll();" />
                                        </Listeners>
                                    </ext:Button>
    
    
                                    <ext:ToolbarSeparator />
                                    <ext:Label ID="TPeriod" runat="server" Html="<b>&nbsp;Period:</b>" />
    
    
                                    <ext:Button ID="ButtonPd" runat="server"  Icon="ResultsetPrevious">
                                    </ext:Button>
                                    <ext:ComboBox ID="testssdsdf" 
                                        runat="server" 
                                        ForceSelection="true"
                                        TriggerAction="All"
                                        Width="170" 
                                        DisplayField="dates"
                                        QueryMode="Local"
                                        ValueField="id" 
                                        Editable="false" >
                                        <Store>
                                            <ext:Store ID="Store2" runat="server">
                                                <Model>
                                                    <ext:Model ID="Model2" IDProperty="id" runat="server">
                                                        <Fields>
                                                            <ext:ModelField Name="id" Type="Int" />
                                                            <ext:ModelField Name="dates" Type="String"/>
                                                        </Fields>
                                                    </ext:Model>
                                                </Model>
                                            </ext:Store>
                                        </Store>
                                    </ext:ComboBox>
                                    <ext:Button ID="ButtonNex" runat="server" Icon="ResultsetNext">
                                    </ext:Button>
                                    <ext:ToolbarSeparator />
    
    
                                    <ext:Label ID="TiId" runat="server" Html="<b>&nbsp;Tid Id:</b>" />
    
    
                                    <ext:ToolbarSeparator />
                                    <ext:Label ID="Timetus" runat="server" Html="<b>&nbsp;Status:</b>" />
                                    <ext:ToolbarFill />
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <Store>
                            <ext:Store ID="Store1" runat="server">
                                <Model>
                                    <ext:Model ID="Model1" runat="server" IDProperty="TaskID">
                                        <Fields>
                                            <ext:ModelField Name="ProjectID" Type="Int" />
                                            <ext:ModelField Name="Name" />
                                            <ext:ModelField Name="TaskID" Type="Int" />
                                            <ext:ModelField Name="Description" />
                                            <ext:ModelField Name="Estimate" Type="Int" />
                                            <ext:ModelField Name="Rate" Type="Float" />
                                            <ext:ModelField Name="Cost" Type="Float" />
                                            <ext:ModelField Name="Due" Type="Date" />
                                        </Fields>
                                    </ext:Model>
                                </Model>
                            </ext:Store>
                        </Store>
                        <ColumnModel ID="ColumnModel1" runat="server">
                            <Columns>
                                <ext:Column ID="Column1"
                                    runat="server"
                                    TdCls="task"
                                    Text="Task"
                                    Sortable="true"
                                    DataIndex="Description"
                                    Hideable="false"
                                    Width="300">
                                </ext:Column>
                         
                                <ext:Column ID="Column2" runat="server" Text="Project" DataIndex="Name" Width="180" />
                         
                                <ext:DateColumn ID="DateColumn1"
                                    runat="server"
                                    Width="130"
                                    Text="Due Date"
                                    Sortable="true"
                                    DataIndex="Due"
                                    Format="MM/dd/yyyy">
                                </ext:DateColumn>
     
                                <ext:Column ID="Column3"
                                    runat="server"  
                                    Width="130"
                                    Text="Estimate"
                                    Sortable="true"
                                    DataIndex="Estimate">
                                </ext:Column>
                         
                                <ext:Column ID="Column4"
                                    runat="server"
                                    Width="130"
                                    Text="Rate"
                                    Sortable="true"
                                    DataIndex="Rate">
                                </ext:Column>
                         
                                <ext:Column
                                    runat="server"
                                    Width="130"
                                    ID="Cost"
                                    Text="Cost"
                                    Sortable="false"
                                    Groupable="false"
                                    DataIndex="Cost">
                                </ext:Column>
                            </Columns>                
                        </ColumnModel>           
                        <View>
                            <ext:GridView ID="GridView7" runat="server" StripeRows="true">
                            </ext:GridView>
                        </View>
                        <Listeners>
                             <ItemMouseDown Fn="saveMouseDown" />
                        </Listeners>
                        <SelectionModel>
                            <ext:RowSelectionModel runat="server" Mode="Single" />
                        </SelectionModel>
                    </ext:GridPanel>
                </Items>
            </ext:Viewport>
    
    
        </form>
      </body>
    </html>
    Attached Thumbnails Click image for larger version. 

Name:	Untitled.png 
Views:	32 
Size:	19.0 KB 
ID:	24308  
    Last edited by Daniil; Nov 02, 2015 at 8:44 AM. Reason: [FIXED] [#931] [3.3]
  2. #2
    Hi @Z,

    Thank you for the report!

    Created an Issue.
    https://github.com/extnet/Ext.NET/issues/931

    It has been fixed in the repo. The fix will go to the 3.3 release.

Similar Threads

  1. Replies: 1
    Last Post: Jul 03, 2014, 8:32 AM
  2. Replies: 1
    Last Post: Nov 07, 2013, 2:40 PM
  3. Replies: 0
    Last Post: Aug 23, 2012, 11:55 PM
  4. Replies: 0
    Last Post: Dec 01, 2011, 6:43 AM
  5. Replies: 1
    Last Post: Jun 08, 2010, 11:38 AM

Posting Permissions