Results 1 to 4 of 4

Thread: Grid with locked columns is out of sync and crashes after reload

    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha Premium User Nux's Avatar
    Join Date
    Feb 2016
    Location
    3city, Poland
    Posts
    39

    Lightbulb Grid with locked columns is out of sync and crashes after reload

    The crash problem occurs in `syncRowHeightFinish`. Since you never check `otherSynchronizer.length` it can go out of bounds and crash and result in nasty layout errors (views will not render properly. Below is a patch that fixes the crash problem

    Still the problem remains that locked columns might get out-of-sync. You have to manually do refresh after the grid store reload. I think ExtJS should figure out on its own that a refresh is required.

    Anyway here is a workaround to properly reload store after some changes in rows. Instead of just doing `grid.getStore().reload()` you need to do:
    PHP Code:
                    grid.suspendLayouts();
                    
    grid.getStore().reload();
                    
    grid.getView().refresh();
                    
    grid.resumeLayouts(); 

    Here's a patch for the crash:
    PHP Code:
    Ext.define('Ext.ux.view.TableSyncPatch', {
        
    override'Ext.view.Table',
        
    syncRowHeightFinish: function(synchronizerotherSynchronizer) {
            var 
    ln synchronizer.length,
                
    bufferedRenderer this.bufferedRenderer,
                
    i;
            
    // PATCH : start
            
    if (ln otherSynchronizer.length){
                
    ln otherSynchronizer.length;
                
    console.warn('[TableSyncPatch] synchronizer.length!=otherSynchronizer.length.'
                    
    +'\nNote! You should probably use grid.getView().refresh() in your code.');
            }
            
    // PATCH : end
            
    for (0lni++) {
                
    synchronizer[i].finish(otherSynchronizer[i]);
            }
            
    // Ensure that both BufferedRenderers have the same idea about scroll range and row height
            
    if (bufferedRenderer) {
                
    bufferedRenderer.syncRowHeightsFinish();
            }
        },
    }
    // Warn if un-tested for specific version.
    , function() {
        if (!
    Ext.getVersion().match('6.2.1')) {
            
    Ext.log({
                
    msg'This patch has not been tested with this version of ExtJS',
                
    level'warn'
            
    });
        }
    }); 

  2. #2
    Sencha User Mark.Brocato's Avatar
    Join Date
    Mar 2015
    Location
    Maryland
    Posts
    482

    Default

    Moved this to the Ext JS forum.

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

    Default

    Thanks for the report. What are you seeing in the browser when the grid gets out of sync and crashes? Are you able to recreate this issue in a test case or with one of our examples?
    https://fiddle.sencha.com/#view/editor

  4. #4
    Sencha Premium User Nux's Avatar
    Join Date
    Feb 2016
    Location
    3city, Poland
    Posts
    39

    Default

    When the problem occurs the two parts of the grid (lock and non-locked) have different number of rows.

    My guess would be that there is some race-condition. I'm guessing the two parts are refreshed independently and can be out of sync when `syncRowHeightFinish` is called. And when there are different number of rows `synchronizer` and `otherSynchronizer` arrays have different lengths. Hence the crash (by crash I mean uncaught error/exception which crashes other scripts and new components have messed up layout).

Similar Threads

  1. columns out of sync in 6.2 RTL locked grid
    By mankz in forum Ext JS 6.x Bugs
    Replies: 2
    Last Post: 3 Nov 2016, 12:31 AM
  2. Replies: 3
    Last Post: 23 Oct 2014, 4:48 AM
  3. Replies: 1
    Last Post: 9 Oct 2012, 10:06 AM
  4. Replies: 1
    Last Post: 31 May 2011, 7:34 AM

Posting Permissions

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