Results 1 to 3 of 3

Thread: [4.2.1.883] Ext.grid.plugin.HeaderResizer throws error in forceFit with sibling grid

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Ext JS Premium Member GustavR's Avatar
    Join Date
    Jun 2009
    Posts
    62

    Arrow [4.2.1.883] Ext.grid.plugin.HeaderResizer throws error in forceFit with sibling grid

    http://www.sencha.com/forum/showthread.php?256224-4.2.0.320-Ext.grid.plugin.HeaderResizer-throws-error-in-forceFit-with-sibling-grid&p=968854&viewfull=1#post968854

    REQUIRED INFORMATION
    Ext version tested:

    Description:
    Steps to reproduce the problem:
    The result that was expected:
    The result that occurs instead:
    Test Case:
    Code:
    var s = Ext.create('Ext.data.ArrayStore', {
        fields: ['dummy'],
        
        data: []
    });
    
    var gridConfig = {
        store: s,
        forceFit: true,
        
        columns: [{
            dataIndex: 'dummy',
            text: 'Dummy',
            flex: 1
        }]
    };
    
    var g = Ext.create('Ext.grid.Panel', gridConfig);
    
    Ext.create('Ext.container.Container', {
        renderTo: Ext.getBody(),
        width: 200,
        height: 200,
        
        layout: {
            type: 'card',
            deferredRender: true
        },
        
        items: [g, Ext.create('Ext.grid.Panel', gridConfig)]
    });
    
    var headerCt = g.headerCt,
        gridColumn = headerCt.getGridColumns()[0],
        headerResizer = headerCt.plugins[0];
        
    // set drag header to simulate click on resize
    headerResizer.dragHd = gridColumn;
    
    headerResizer.getConstrainRegion(); // throws error


    HELPFUL INFORMATION

    Possible fix:
    Code:
    Ext.define('Ext.fix.grid.plugin.HeaderResizer', {
        override: 'Ext.grid.plugin.HeaderResizer',
        
        getConstrainRegion: function() {
            var me       = this,
                dragHdEl = me.dragHd.el,
                nextHd;
    
            // If forceFit, then right constraint is based upon not being able to force the next header
            // beyond the minColWidth. If there is no next header, then the header may not be expanded.
            if (me.headerCt.forceFit) {
                nextHd = me.dragHd.nextSibling('gridcolumn:not([hidden]):not([isGroupHeader])');
            }
    
            return me.adjustConstrainRegion(
                Ext.util.Region.getRegion(dragHdEl),
                0,
                me.headerCt.forceFit ? (nextHd ? nextHd.getWidth() - me.minColWidth : 0) : me.maxColWidth - dragHdEl.getWidth(),
                0,
                me.minColWidth
            );
        }
    });
    Explanation
    Was: me.dragHd.nextNode Returns first column of second grid
    Now: me.dragHd.nextSibling Returns
    null

    *EDIT BY SLEMMON
    Issue observed in 4.2.1.883 and 4.2.1.760. Tested ok in 4.2.1.744
    Last edited by slemmon; 4 Jun 2013 at 8:54 AM. Reason: Additional test notes

  2. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha Premium Member joshua.ball@osi.com's Avatar
    Join Date
    Nov 2012
    Location
    Sacramento, CA
    Posts
    43

    Default Look at Previous Bug

    Hello All,

    Please look at the previous bug that GustavR created for this exact same issue:

    http://www.sencha.com/forum/showthre...h-sibling-grid

    He reports that this bug still exists in the 4.2.2 codebase, and I've listed a few examples of where I've seen this bug as well. Definitely something wrong with the "getWidth" function of the plugin/views noted in that bug, and any calls to getWidth have to be handled inside of try/catch statements if you want to proceed with the path of execution. Any chance a workaround can be made available before another release?

    Thanks,

    -Josh

Posting Permissions

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