Results 1 to 9 of 9

Thread: forceFit changing column widths on every layout run

    This duplicates another forum thread, you can visit that thread here.
  1. #1
    Ext JS Premium Member
    Join Date
    Jun 2009
    Posts
    63

    Exclamation forceFit changing column widths on every layout run

    Fiddle:
    https://fiddle.sencha.com/#fiddle/l7l

    Ext version tested:


    • 5.1.0.107
    • 5.1.1.451
    • 5.1.2.748
    • 5.1.3.228

    Browser versions tested against:

    • Chrome 41.0.2272.118
    • Firefox 37.0.1

    DOCTYPE tested against:

    • <!DOCTYPE html>
    • <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    Description:
    Every layout run in a grid with forceFit causes the width of the columns to change slightly. This is caused by a rounding error in Ext.layout.container.Box#roundFlex.
    The following Code fixes the problem:
    Code:
    Ext.define('Ext.fix.layout.container.Box', {
        override: 'Ext.layout.container.Box',
        
        roundFlex: function(width) {
            return Math.round(width);
        }
    });
    Steps to reproduce the problem:

    • Create GridPanel with forceFit and bunch of columns
    • Run updateLayout

    The result that was expected:

    • The column widths stay the same

    The result that occurs instead:

    • The columns change their width

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Thanks for the report and override. Looks like this one has been reported:
    http://www.sencha.com/forum/showthread.php?296995

  3. #3
    Ext JS Premium Member
    Join Date
    Jun 2009
    Posts
    63

    Default

    Bug still exists in 5.1.1.451. Is there any progress on the Fix yet?

  4. #4
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    I see movement on this (proposed fix, nothing merged) so I'm hopeful that a resolution will be soon to follow.

  5. #5
    Sencha - Support Team
    Join Date
    Mar 2015
    Location
    Chicago
    Posts
    239

    Default

    Hi,

    I can't reproduce this problem. Trying with Chrome 44 and Firefox 39.0.3.

    Thanks,
    Guilherme Lopes
    Sencha Support

  6. #6
    Ext JS Premium Member
    Join Date
    Jun 2009
    Posts
    63

    Default

    Which ExtJs-Version have you tested it against? I can still reproduce it. The Bug does not throw an Exception, it changes the column widths, so you have to open your developer tools to see the change.

  7. #7
    Sencha - Support Team
    Join Date
    Mar 2015
    Location
    Chicago
    Posts
    239

    Default

    Hi,

    For some reason the problem stopped happening last night and now it's back
    Thanks for providing this override, however, I feel like a safer way to go would be override the gridcolumn layout instead of the hbox layout itself.

    Code:
    Ext.define('Ext.override.grid.ColumnLayout', {
        override: 'Ext.grid.ColumnLayout',
        
        roundFlex: function(width) {
            return Math.round(width);
        }
    });
    Guilherme Lopes
    Sencha Support

  8. #8
    Ext JS Premium Member
    Join Date
    Jun 2009
    Posts
    63

    Default

    Bug still exists in 5.1.2.748. Any status update?

  9. #9
    Sencha Premium User
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    807

    Default

    Finally, it's fixed in 6.5.1

Similar Threads

  1. Auto fit column widths instead of having fix widths
    By webfriend13 in forum Ext: Q&A
    Replies: 6
    Last Post: 13 Apr 2014, 9:50 AM
  2. Replies: 1
    Last Post: 6 Mar 2013, 10:47 AM
  3. Replies: 2
    Last Post: 26 May 2012, 7:14 AM
  4. Replies: 1
    Last Post: 27 May 2011, 2:50 AM
  5. CSS changing widths of panels in ext
    By D-L in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 12 Feb 2009, 4:48 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •