Properties Methods Events Config Options Direct Link

    GroupSummary
      HybridSummary

# Class Ext.ux.grid.HybridSummary

Package: | Ext.ux.grid
Defined In: | GroupSummary.js
Class: | HybridSummary
Extends: | GroupSummary

Adds capability to specify the summary data for the group via json as illustrated here:

    {
        data: [
            {
                projectId: 100,     project: 'House',
                taskId:    112, description: 'Paint',
                estimate:    6,        rate:     150,
                due:'06/24/2007'
            },
            ...
        ],

        summaryData: {
            'House': {
                description: 14, estimate: 9,
                       rate: 99, due: new Date(2009, 6, 29),
                       cost: 999
            }
        }
    }

## Config Options

Config Options | Defined By
--- | ---
| summaryRenderer : Function Renderer example:summaryRenderer: function(v, params, data){ return ((v === 0 || v > 1) ? '(' + v +' Tasks)' : '(... Renderer example:
    summaryRenderer: function(v, params, data){
        return ((v === 0 || v > 1) ? '(' + v +' Tasks)' : '(1 Task)');
    },
| GroupSummary
| summaryType : String The type of calculation to be used for the column. For options available see Calculations. | GroupSummary

## Public Properties

Property | Defined By
--- | ---
| Calculations : Object Calculation types for summary row:<div class="mdetail-params"> sum : <div class="sub-desc"> count : <div class="sub-d... Calculation types for summary row: `sum` : `count` : `max` : `min` : `average` : Custom calculations may be implemented. An example of custom `summaryType=totalCost`:
    // define a custom summary function
    Ext.ux.grid.GroupSummary.Calculations['totalCost'] = function(v, record, field){
        return v + (record.data.estimate * record.data.rate);
    };
| GroupSummary

## Public Methods

Method | Defined By
--- | ---
| getSummaryData( `String groupValue` ) : Object Returns the summaryData for the specified groupValue or null. Returns the summaryData for the specified groupValue or null. Parameters: `groupValue` : String Returns: `Object` summaryData | HybridSummary
| setActiveTab( `String/Panel tab` ) : void Sets the specified tab as the active tab. This method fires the beforetabchange event which can return false to cance... Sets the specified tab as the active tab. This method fires the beforetabchange event which can return false to cancel the tab change. Parameters: `tab` : String/Panel The id or tab Panel to activate Returns: void | HybridSummary
| showSummaryMsg( `String groupValue`, `String msg` ) : void Show a message in the summary row. grid.on('afteredit', function(){ var groupValue = 'Ext Forms: Field Anchoring'... Show a message in the summary row.
    grid.on('afteredit', function(){
        var groupValue = 'Ext Forms: Field Anchoring';
        summary.showSummaryMsg(groupValue, 'Updating Summary...');
    });
Parameters: `groupValue` : String `msg` : String Text to use as innerHTML for the summary row. Returns: void | GroupSummary
| toggleSummaries( `Boolean visible` ) : void Toggle the display of the summary row on/off Toggle the display of the summary row on/off Parameters: `visible` : Boolean `true` to show the summary, `false` to hide the summary. Returns: void | GroupSummary
| updateSummaryData( `String groupValue`, `Object data`, [`Boolean skipRefresh`] ) : void grid.on('afteredit', function(){ var groupValue = 'Ext Forms: Field Anchoring'; summary.showSummaryMsg(groupV...
    grid.on('afteredit', function(){
        var groupValue = 'Ext Forms: Field Anchoring';
        summary.showSummaryMsg(groupValue, 'Updating Summary...');
        setTimeout(function(){ // simulate server call
            // HybridSummary class implements updateSummaryData
            summary.updateSummaryData(groupValue,
                // create data object based on configured dataIndex
                {description: 22, estimate: 888, rate: 888, due: new Date(), cost: 8});
        }, 2000);
    });
Parameters: `groupValue` : String `data` : Object data object `skipRefresh` : Boolean (Optional) Defaults to false Returns: void | HybridSummary

## Public Events

This class has no public events.