[CLOSED] Question on grid summary with locking

  1. #1

    [CLOSED] Question on grid summary with locking

    Hi, I used to get grid summary data from grid.features, but after add locking columns, the grid.features = null and I need to find features from grid.lockgrid.features. Is there a common method that can return me grid features ? I am confused on when/how I should deal with the lockgrid.
    I tired to disable/enable grouping with lock several times, the display starts messed up. I may create separated ticket for this, for now, I need to understand the lock grid.
    Thanks
    -szhang
    Last edited by Daniil; Sep 29, 2015 at 5:42 AM. Reason: [CLOSED]
  2. #2
    Hi @susanz,

    Internally, a locking grid consists of two GridPanels - locked and normal. In this case a GridPanel reference becomes a wrapper from two GridPanels.
    Also there are two instances of a Summary feature - one goes to a locked GridPanel and another - to a normal one.

    These code snippets demonstrate how you could handle it.
    var getSummaryFeature = function (grid) {
        var summaryFeature;
    
        Ext.Array.each(grid.features, function (feature) {
            if (feature.ftype === "summary") {
                summaryFeature = feature;
                return false; // Stops "each" iterating
            }
        });
    
        return summaryFeature;
    };
    if (grid.lockedGrid) {    
        // You are dealing with a locking grid    
        var lockedSummary = getSummaryFeature(grid.lockedGrid),        
            normalSummary = getSummaryFeature(grid.normalGrid);
    
        // Do the required with both the summary features
    } else {    
        // You are dealing with a regular grid    
        var summary = getSummaryFeature(grid);
    
        // Do the required with the only summary feature
    }
  3. #3
    Got it, thanks Daniil, it works now.

Similar Threads

  1. Replies: 6
    Last Post: Sep 15, 2017, 3:04 AM
  2. Locking Grid View In User Control
    By jhou82 in forum 1.x Help
    Replies: 1
    Last Post: Aug 09, 2013, 6:44 PM
  3. Grouping summary and summary in one grid
    By PetrSnobelt in forum 2.x Help
    Replies: 1
    Last Post: Apr 16, 2013, 9:59 AM
  4. [CLOSED] Locking Grid and AddColumn
    By paulc in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 23, 2011, 11:05 AM
  5. [CLOSED] locking grid view in right side?
    By Suntico in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 19, 2011, 11:38 AM

Posting Permissions