You found a bug! We've classified it as a bug in our system. We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    51
    Vote Rating
    2
    ExTriqui is on a distinguished road

      0  

    Default AbstractSummary fixes

    AbstractSummary fixes


    Hi. There are a couple of things I don't like about AbstractSummary, If you agree with me maybe we could easlily fix them.

    Version 4.1

    1. getColumnValue. I think the check for undefined values should be moved after the renderer has been called.
    Code:
        getColumnValue: function(column, summaryData){
            var comp     = Ext.getCmp(column.id),
                value    = summaryData[column.dataIndex],
                renderer = comp.summaryRenderer;
    
    
            if (renderer) {
                value = renderer.call(
                    comp.scope || this,
                    value,
                    summaryData,
                    column.dataIndex
                );
            }
    
    
            if (!value && value !== 0) {
                value = '\u00a0';
            }
            return value;
        },
    2. getSummary. I would like to receive the dataIndex (or field) when my custom aggregation function are being called. To do this we only need to pass the field to the aggregate function in Store, this is the same behavior followed in Store when it calls its aggregate function.
    Code:
        getSummary: function(store, type, field, group){
            if (type) {
                if (Ext.isFunction(type)) {
                    return store.aggregate(type, null, group, [field]);
                }
    
    
                switch (type) {
                    case 'count':
                        return store.count(group);
                    case 'min':
                        return store.min(field, group);
                    case 'max':
                        return store.max(field, group);
                    case 'sum':
                        return store.sum(field, group);
                    case 'average':
                        return store.average(field, group);
                    default:
                        return group ? {} : '';
                        
                }
            }
        }
    Please, let me know what you think.
    Thank you very much.

    I have another proposal to modify the Summary class, using the method prepareData from Ext-grid-header-Container instead of that getPrintData, that forces you to use a differente renderer for the summary cells and doesn't allow to modify the metadata, but I think I will open another bug when I have a working solution.
    Last edited by ExTriqui; 19 Jun 2012 at 2:55 AM. Reason: Code formatting

  2. #2
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,365
    Vote Rating
    135
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      0  

    Default


    Thanks for the report - your suggestions are great and we've implemented them for the next release!

    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  3. #3
    Sencha Premium Member Troy Wolf's Avatar
    Join Date
    May 2007
    Location
    Kansas City
    Posts
    250
    Vote Rating
    2
    Troy Wolf is on a distinguished road

      0  

    Default


    Quote Originally Posted by dongryphon View Post
    Thanks for the report - your suggestions are great and we've implemented them for the next release!
    So I assume there would be no need for this patch now and this thread should be marked CLOSED?

Thread Participants: 2

Tags for this Thread