Our blazing fast Grid component built with pure JavaScript


Post by tjmeal »

Dear all,

I have a column which uses aggregates Sum > which works perfectly.

I would like to create an additional functionality > which when the user selects a row / rows > on the aggregate sum to show only the selected row's sum and not the overall grid Sum.

If there is no selected row to show the overall grid sum, how can i config that ?

    {
      id: 'transferPrice-field',
      text: 'Price',
      field: 'transferPrice',
      type: 'aggregate',
      sum: 'sum',
      groupable: false,
      hidden: true,
      ...gridColumnConfig,
      minWidth: 150,
      format: {
        style: 'currency',
        currency: 'EUR',
        fraction: 2,
      },
      editor: {
        required: true
      },
      renderer: ({value, record, cellElement}) => {
        if (record.hasGeneratedId && (value !== null && value !== undefined)) {
          cellElement.classList.add('b-cell-dirty');
        }
        return value;
      }
    },

Thanks in advance.


Post by marcio »

Hey tjmeal,

Thanks for reaching out.

We have https://bryntum.com/products/grid/docs/api/Grid/feature/Summary#property-selectedOnly which you can update to true to sum only selected rows.

Best regards,
Márcio

How to ask for help? Please read our Support Policy


Post by tjmeal »

Perfect,

Thank you !!


Post Reply