Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

495
Vistas
How to set one specific raw in bottom of the table every time in AG-grid?

I have created a table using AG-grid. here is the code

.HTML

<ag-grid-angular #agGrid 
        style="width: 100%; height: 100%; font-size: 12px;" 
        class="ag-theme-alpine"
        [rowData]="rowData"
        [columnDefs]="columnDefs"
    >
    </ag-grid-angular>

.Ts

columnDefs =  [{  
        headerName: '',
        field: 'rush',
        width: 53,
        resizable: true,
        cellRendererFramework: RegularGridCheckboxComponent, 
        cellRendererParams: { clickHandler: this.checkBoxClickHander.bind(this)},
      },
      {
        headerName: 'Type',
        field: 'type',
        width: 74,
        resizable: true,
      },
      {
        headerName: 'Address',
        field: 'address',
        width: 176,
        resizable: true
      }]

I have some rowData I am not include those in here

Actually I want to create a grid design like following image. You can see bottom of the grid have one specific raw

here is the image

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use Footer to fix a row in the bottom: .HTML

  <ag-grid-angular #agGrid 
            style="width: 100%; height: 100%; font-size: 12px;" 
            class="ag-theme-alpine"
            [rowData]="rowData"
            [autoGroupColumnDef]="autoGroupColumnDef"
            [columnDefs]="columnDefs">
        </ag-grid-angular>

.TS add this

 public autoGroupColumnDef: ColDef = {
        minWidth: 300,
        cellRendererParams: {
          innerRenderer: MyInnerRenderer,
        },
      };

Create a new component: for me its MyInnerRenderer

MyInnerRenderer

import { Component } from '@angular/core';
import { ICellRendererAngularComp } from 'ag-grid-angular';
import { ICellRendererParams } from 'ag-grid-community';

@Component({
  selector: 'total-value-component',
  template: `<span style="color: {{ color }}; font-weight: {{ fontWeight }};"
    >{{ prefix }} {{ cellValue }}</span
  >`,
})
export class MyInnerRenderer implements ICellRendererAngularComp {
  public cellValue = '';
  public color = '';
  public fontWeight = '';
  public prefix = '';

  // gets called once before the renderer is used
  agInit(params: ICellRendererParams): void {
    this.cellValue = params.value;
    this.color = params.node.footer ? 'navy' : '';
    this.fontWeight =
      params.node.footer && params.node.level === -1 ? 'bold' : '';
    if (params.node.footer) {
      this.prefix = params.node.level === -1 ? 'Grand Total' : 'Sub Total';
    }
  }

  refresh(params: ICellRendererParams) {
    return false;
  }
}

for more details Refer here

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda