Ext.define('saas.override.grid.feature.Summary', { override: 'Ext.grid.feature.Summary', // Synchronize column widths in the docked summary Component or the inline summary row // depending on whether we are docked or not. afterHeaderCtLayout: function(headerCt) { var me = this, view = me.view, columns = view.getVisibleColumnManager().getColumns(), column, len = columns.length, i, summaryEl, el, width, innerCt; if (me.showSummaryRow && view.refreshCounter) { if (me.dock) { summaryEl = me.summaryBar.el; width = headerCt.getTableWidth(); innerCt = me.summaryBar.innerCt; // Stretch the innerCt of the summary bar upon headerCt layout me.summaryBar.item.setWidth(width); // headerCt's tooNarrow flag is set by its layout if the columns overflow. // Must not measure+set in after layout phase, this is a write phase. if (headerCt.tooNarrow) { width += Ext.getScrollbarSize().width; } innerCt.setWidth(width); } else { summaryEl = Ext.fly(Ext.fly(view.getNodeContainer()).down('.' + me.summaryItemCls, true)); } // If the layout was in response to a clearView, there'll be no summary element if (summaryEl) { for (i = 0; i < len; i++) { column = columns[i]; el = summaryEl.down(view.getCellSelector(column), true); if (el) { // 【override】当最后一列为flex且列数较少时会导致合计对不齐的情况 Ext.fly(el).setWidth(column.el.getWidth() || (column.width || (column.lastBox ? column.lastBox.width : 100))); } } } } }, });