1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    21
    Vote Rating
    2
    hlurger is on a distinguished road

      0  

    Default Unanswered: groupingsummary minmax-function

    Unanswered: groupingsummary minmax-function


    Hi,
    I have a grid with the groupingsummary-feature!

    One column is a date column, and in the summary I want to display the min and the max date! (e.g. from 18.11 - 25.11.2012)
    I thought, this will be pretty easy by wirting my own summaryType function!

    Code:
                
    summaryType: function(records) { 
             //get min and max date from records
             return "from Ext.Date.format(Min-Date,"d.m.") -  Ext.Date.format(Max-Date."d.m.")
    }
    This does not work, because you have to return one date-value in a date-column or one int value in a int column and so on.... Afterwards summaryRenderer with my calculated value is called!

    Question 1: Is there a way, to forward two values to the summaryRenderer?

    Question 2: Wouldn't it be better, if I am providing my own summary function, that I also provide my own output in ONE function!

    Question 3: The only workaround I can think of, is that I make a String-column and parsing the dates myself! Any better solutions??

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,142
    Answers
    3505
    Vote Rating
    855
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You should be able to return a string in summaryType and have no issues.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread