1. #1
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,592
    Vote Rating
    323
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default invalidateScroller & determineScrollbars

    invalidateScroller & determineScrollbars


    invalidateScroller and determineScrollbars both seem to have been removed. Given these methods were both documented in 4.0 I would suggest it is not appropriate to just remove them from 4.1. If they no longer make sense they should be marked as deprecated and given implementations that simply log a warning in debug mode.

    I've removed them from my code and I wanted to check that my new solution is the 'correct' way to do it for 4.1. My use case is a little complicated so I've produced a much simplified version. The problem occurs when a grid row changes height after it has been rendered:

    Code:
    .x-grid-row-selected {
        height: 400px;
    }
    Code:
    var grid = Ext.create('Ext.grid.Panel', {
        height: 300,
        renderTo: Ext.getBody(),
        width: 300,
        columns: [{
            dataIndex: 'name',
            flex: 1,
            text: 'Name'
        }],
        listeners: {
            select: function() {
                grid.invalidateScroller();
                grid.determineScrollbars();
            }
        },
        store: {
            data: [{name: 'Ed'}],
            fields: ['name']
        }
    });
    In this example, selecting a row will make it much taller due to the CSS, such that the grid needs a vertical scrollbar when it didn't initially. In 4.1-pr1 I've had to change my select listener to:

    Code:
    select: function() {
        grid.doLayout();
    }
    So far this appears to work fine. Without the call to doLayout() I also get a horizontal scrollbar, which I don't want.

    I notice that the official RowExpander demo suffers from a similar problem if you trim the data down such that it initially doesn't have a vertical scrollbar.

  2. #2
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,346
    Vote Rating
    134
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    Thanks for the awesome bug report. Your solution looks correct for 4.1 and you are right about how we should handle the obsolete methods.
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  3. #3
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,346
    Vote Rating
    134
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    I've added back these two methods and appropriate docs. You could avoid the (costly) layout if the scrollbar state is not changing from last time the layout was run. If that has a measurable impact in your situation.
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

Thread Participants: 1