Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

213
Visualizações
Why gridApi.onFilterChanged() event redirect the page

I have a button to respond to filter function

<div class="col-md-1">
     <button (click)="applyFilter()" class="btn btn-primary"
     style="float: right;">Search</button>                     
</div>    


applyFilter() {
    this.gridApi.onFilterChanged();
}

isExternalFilterPresent(): boolean {
    return true;
}

doesExternalFilterPass(node: RowNode): boolean {
    return true;
}

constructor(private http: HttpClient, private _snackBar: MatSnackBar) {
    this.gridOptions = {
        editType: 'fullRow',
        columnDefs: this.columnDefs,
        pagination: true,
        animateRows: true,
        isExternalFilterPresent: this.isExternalFilterPresent.bind(this),
        doesExternalFilterPass: this.doesExternalFilterPass.bind(this),
    };
}

<ag-grid-angular style="width: 100%; height:600px;" class="ag-theme-alpine"
    [defaultColDef]="defaultColDef"
    rowSelection='single' [gridOptions]="gridOptions"
    (rowValueChanged)="onRowChanged($event)" (gridReady)="onGridReady($event)">
</ag-grid-angular>

very basic external filter implementation to ag-Grid

however when click the search button, the whole page direct to the previous page which is very weird and I am not able to debug.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Well not sure if it is the best way to resolve it, but I got it to work by returning a false to applyFilter()

applyFilter() {
    this.gridApi.onFilterChanged();
    return false;   /// yea that fix it...
}

So @nullptr.t is right, the button is acting like submitting the form instead of button

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda