Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
255
GroupBy Summaries
posted

Hi, 

I am trying to use GroupBy summaries I want to format the row before displaying. Like its showing the ColumnName, operation and the value. However I just want a trim version of ColumnName and I don't want to show the operation and just the value. 

For example, If Column is ProductName, its currently showing ProductName sum 0.10, I want it as Name 0.10

columnSettings: [
{
columnKey: "ProductName",
summaries: [
{
summaryFunction: "sum",
resultTemplate: "{1}",
customSummary: function (data) {
if (data < 0) {
return "(" + data + ")";
}
return data;
}
}
]
},

Parents
No Data
Reply
  • 17590
    Offline posted

    Hello Hamza,

    Setting text in grouping summaries can be accomplished by setting text option. This option specifies the summary text that will be shown before the value. For example:

    features: [
        {
              name: "GroupBy",
              type: "local",
              summarySettings: {
                summaryFormat: "#0"
              },
              columnSettings: [
               {
                   columnKey: "Job", isGroupBy: true
               },
              {
                   columnKey: "TotalWgt",
                   summaries: [
                    {
                        summaryFunction: "sum",
                        text: "Weight "
                    }
            ]
           }      
          ]
         }
      ]

    When text option is set the aggregate function (sum in your scenario is not going to be displayed). Please keep in mind that the string set to the text option is going to be displayed after the header text of your column and currently this is the only option.

    In case that you would like to have a customizable template for Group By summaries my suggestion is to log a new product idea at http://ideas.infragistics.com . There are many benefits to submitting a product idea:
        -   Direct communication with our product management team regarding your idea
        -   Notifications whenever new information regarding your idea becomes available
        -   Allow you to shape the future of our products
        -   You and other developers can discuss existing product ideas with members of our product management team

    Steps to create your idea:

           1. Log into the Infragistics Product Ideas site (create a new Log In if needed)
           2. Navigate to the product of your choice
           3. Add your product idea and be sure to be specific and provide as much details as possible

    The Product Idea site puts you in the driver`s seat and allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community and see if someone from the product team has additional questions for you.

     

Children
No Data