[CLOSED] Resizing columns with Flex=1 results in sorting

  1. #1

    [CLOSED] Resizing columns with Flex=1 results in sorting

    Hello
    I have relativelly strange problem, hope you will be able to reproduce.
    In fact - in order to reproduce you need a grid with all columns with dynamic size (Flex=1), resiable columns and the sorting setup ( does not matter if local or remote)

    Then - when resizing column using mouse, it's "sometimes" get sorted as well
    the "sometimes" is relativelly well defined - if the mouse does not drag the column right in the middle ( between columns), but little left or right

    Not reproducible on columns with fixed size

    Is that purposelly like that?


    for illustration purpose I'm adding grid where it is reproducible (note that easier reproducible on gray theme, but could be reproduced on default theme as well), nearly copied from your samples + added "Flex=1" to columns

    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="System.Collections.Generic" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Store1.DataSource = this.Jobs;
            this.Store1.DataBind();
        }
        
        private List<Job> Jobs
        {
            get
            {
                List<Job> jobs = new List<Job>();
    
                for (int i = 1; i <= 50; i++)
                {
                    jobs.Add(new Job(
                                i, 
                                "Task" + i.ToString(), 
                                DateTime.Today.AddDays(i), 
                                DateTime.Today.AddDays(i + i), 
                                (i%3 == 0)));
                }
    
                return jobs;
            }
        }
    
        public class Job
        {
            public Job(int id, string name, DateTime start, DateTime end, bool completed)
            {
                this.ID = id;
                this.Name = name;
                this.Start = start;
                this.End = end;
                this.Completed = completed;
            }
    
            public int ID { get; set; }
            public string Name { get; set; }
            public DateTime Start { get; set; }
            public DateTime End { get; set; }
            public bool Completed { get; set; }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>GridPanel with FitLayout - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />    
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            
            <ext:Window 
                ID="Window1" 
                runat="server"
                Collapsible="true"
                Maximizable="true"
                Icon="Lorry" 
                Title="Job List"
                Width="600"
                Height="300"
                X="50"
                Y="50"
                Layout="Fit">
                <Items>
                    <ext:GridPanel
                        runat="server" 
                        Header="false"
                        Border="false">                         
                        <Store>
                            <ext:Store ID="Store1" runat="server" PageSize="10">
                                <Model>
                                    <ext:Model runat="server" IDProperty="ID">
                                        <Fields>
                                            <ext:ModelField Name="ID" />
                                            <ext:ModelField Name="Name" />
                                            <ext:ModelField Name="Start" Type="Date" />
                                            <ext:ModelField Name="End" Type="Date" />
                                            <ext:ModelField Name="Completed" Type="Boolean" />
                                        </Fields>
                                    </ext:Model>
                                </Model>
                            </ext:Store>
                        </Store>
                        <ColumnModel runat="server">
                            <Columns>
                                <ext:Column runat="server" 
                                    Flex="1"
                                    Text="ID" 
                                    Width="40" 
                                    Sortable="true" 
                                    DataIndex="ID">
                                    <Filter>
                                        <ext:NumberFilter />
                                    </Filter>
                                </ext:Column>
                                <ext:Column runat="server" 
                                    Text="Job Name" 
                                    Sortable="true" 
                                    DataIndex="Name"
                                    Flex="1">
                                    <Filter>
                                        <ext:StringFilter />
                                    </Filter>
                                </ext:Column>
                                <ext:DateColumn runat="server" 
                                    Flex="1"
    
                                    Text="Start" 
                                    Sortable="true" 
                                    DataIndex="Start"
                                    Format="yyyy-MM-dd">
                                    <Filter>
                                        <ext:DateFilter>
                                            <DatePickerOptions runat="server" TodayText="Now" />
                                        </ext:DateFilter>
                                    </Filter>
                                </ext:DateColumn>
                                <ext:DateColumn runat="server" 
                                    Text="End" 
                                    Flex="1"
                                    Sortable="true" 
                                    DataIndex="End"
                                    Format="yyyy-MM-dd">
                                    <Filter>
                                        <ext:DateFilter>
                                            <DatePickerOptions runat="server" TodayText="Now" />
                                        </ext:DateFilter>
                                    </Filter>
                                </ext:DateColumn>
                                <ext:Column runat="server" 
                                    Text="Completed" 
                                    Flex="1"
                                    Sortable="true" 
                                    DataIndex="Completed">
                                    <Renderer Handler="return (value) ? 'Yes':'No';" />
                                    <Filter>
                                        <ext:BooleanFilter />
                                    </Filter>
                                </ext:Column>
                            </Columns>
                        </ColumnModel>
                        <View>
                            <ext:GridView runat="server" LoadMask="false" />
                        </View>
                        <Plugins>
                            <ext:GridFilters runat="server" />
                        </Plugins>
                        <BottomBar>
                            <ext:PagingToolbar 
                                runat="server" 
                                DisplayInfo="true"
                                DisplayMsg="Displaying Jobs {0} - {1} of {2}"
                                />
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
            </ext:Window>
        </form>
    </body>
    </html>
    Last edited by Daniil; Sep 29, 2015 at 5:41 PM. Reason: [CLOSED]
  2. #2
    Hi @Zdenek,

    Thank you for the report!

    It appears to be a known issue.
    https://github.com/extnet/Ext.NET/issues/821

    Here is a possible fix/workaround.
    http://forums.ext.net/showthread.php...l=1#post273166

Similar Threads

  1. Replies: 3
    Last Post: Nov 18, 2013, 4:43 AM
  2. Replies: 0
    Last Post: Sep 16, 2013, 8:26 AM
  3. Replies: 13
    Last Post: Jun 07, 2011, 5:45 AM
  4. RowEditor plugin and resizing columns
    By Daniil in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 15, 2011, 8:38 AM
  5. [CLOSED] TreeGrid columns indenting too much and not sorting
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 03, 2010, 3:15 PM

Posting Permissions