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
590
Facing issue while applying initialSummaryDescriptions.
posted

Hi

I want a small clarification on one of the use case related to IgrDataGrid (https://es.infragistics.com/products/ignite-ui-react/react/components/grids/data-grid/overview).

I have used IgrDataGrid, in that when I try to set initial summary description with the following code snippet.

const summary: IgrColumnSummaryDescription[] = [];

const summaryColumn= new IgrColumnSummaryDescription();
summaryColumn.field = 'TestColumn';
summaryColumn.displayName = 'Test Display Name';
summaryColumn.calculatorDisplayName = '';
summaryColumn.operand = DataSourceSummaryOperand.Sum;
summary.push(summaryColumn);

This is the code snippet I'm using , here I'm passing displayName = 'Test Display Name' and  calculatorDisplayName  as Empty string still I'm getting  result  TestColumn sum 555 , as  displayName is  'Test Display Name' and calculatorDisplayName   is Empty string so I'm expecting result like this Test Display Name 555

So, for this I need to know how can we achieve that , If there is any solution for this please suggest  as I need to implement this in my IgrDataGrid.   

Hoping for a positive response.

Thanks!!!

Parents
  • 34810
    Offline posted

    Hello Shubham,

    From your description, it sounds like you are looking to show some custom text instead of “Sum” in the summary. You can do this using the calculatorDisplayName property of the IgrColumnSummaryDescription that you are defining. For example, using a summary of the following:

            const peopleCount = new IgrColumnSummaryDescription();
            peopleCount.field = "Photo";
            peopleCount.operand = DataSourceSummaryOperand.Count;       
            peopleCount.calculatorDisplayName = "THIS IS CALC DISPLAY NAME";       
            this.grid.summaryDescriptions.add(peopleCount);

    This will result in a summary view like the attached screenshot. For reference, the sample that was modified with the above summary and shown in the screenshot is downloadable here: https://github.com/IgniteUI/igniteui-react-examples/tree/master/samples/grids/data-grid/overview.

    Please let me know if you have any other questions or concerns on this matter.

Reply Children