partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

Ext.grid.feature.Summary-selectorFix.js (1960B)


      1 /**
      2  * Fixeds an issue where the summaryRowSelector is null
      3  */
      4 Ext.define('PartKeepr.grid.feature.Summary', {
      5     override: 'Ext.grid.feature.Summary',
      6 
      7     fullSummaryTpl: [
      8         '{%',
      9         'var me = this.summaryFeature,',
     10         '    record = me.summaryRecord,',
     11         '    view = values.view,',
     12         '    bufferedRenderer = view.bufferedRenderer;',
     13         'this.nextTpl.applyOut(values, out, parent);',
     14         'if (!me.disabled && me.showSummaryRow && view.store.isLast(values.record)) {',
     15         'if (bufferedRenderer) {',
     16         '    bufferedRenderer.variableRowHeight = true;',
     17         '}',
     18         'me.outputSummaryRecord((record && record.isModel) ? record : me.createSummaryRecord(view), values, out, parent);',
     19         '}',
     20         '%}',
     21         {
     22             priority: 300,
     23             beginRowSync: function (rowSync)
     24             {
     25                 rowSync.add('fullSummary', this.summaryFeature.summaryRowSelector);
     26             },
     27             syncContent: function (destRow, sourceRow, columnsToUpdate)
     28             {
     29                 destRow = Ext.fly(destRow, 'syncDest');
     30                 sourceRow = Ext.fly(sourceRow, 'sycSrc');
     31                 var selector = this.summaryFeature.summaryRowSelector;
     32 
     33                 var
     34                     destSummaryRow = destRow.down(selector, true),
     35                     sourceSummaryRow = sourceRow.down(selector, true);
     36                 // Sync just the updated columns in the summary row.
     37                 if (destSummaryRow && sourceSummaryRow) {
     38                     // If we were passed a column set, only update those, otherwise do the entire row
     39                     if (columnsToUpdate) {
     40                         this.summaryFeature.view.updateColumns(destSummaryRow, sourceSummaryRow, columnsToUpdate);
     41                     } else {
     42                         Ext.fly(destSummaryRow).syncContent(sourceSummaryRow);
     43                     }
     44                 }
     45             }
     46         }
     47     ],
     48 });