Create a button on the ag-grid-angular

0

How to create a button on the grid

app.component.hmtl

<!--The content below is only a placeholder and can be replaced.-->
<div style="text-align:left">
  <span> Tela Cancelamento de Vendas </span>
    <ag-grid-angular 
        style="width: 800px; height: 400px;" 
        class="ag-theme-balham"
        [pagination]="true"
        [rowData]="rowData" 
        [columnDefs]="columnDefs"
        >
    </ag-grid-angular>

</div>

app.component.ts

import { Component } from '@angular/core';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.scss']
})


export class AppComponent {
    title = 'app';

    columnDefs = [
        {headerName: 'Cliente', field: 'make' },
        {headerName: 'Bandeira', field: 'model' },
        {headerName: 'Valor da Venda', field: 'valor'},
        {headerName: 'Acao', field: ''}
    ];

    rowData = [
        { make: 'RC Advogados', model: 'Visa', valor: 35000 },
        { make: 'OAB Brasilia', model: 'Master Card', valor: 32000 },
        { make: 'Espaco Juridico', model: 'HipperCard', valor: 72000 }
    ];
}

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { AgGridModule } from 'ag-grid-angular';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, AgGridModule.withComponents([])],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {}

Image

    
asked by anonymous 26.09.2018 / 16:42

0 answers