“角度”按钮中的“ Ag网格”不可见,并在过滤器中应用

问题描述

我有一个网格网格,其中过滤器是从角度网页的示例中复制的: enter link description here

这是我的代码

  <ag-grid-angular #agGrid
                   style="width: 100%; height: 200px;" class="ag-theme-mystyle"
                   id="myGrid"
              (gridReady)="onGridReady1($event)"
                   [columnDefs]="columnDefs1"
                   [defaultColDef]="defaultColDef1"
                   [rowData]="rowData1"
                    ></ag-grid-angular>

和打字稿中

this.columnDefs1 = [
      {
        field: 'athlete',filter: 'agTextColumnFilter',filterParams: {
          buttons: ['reset','apply'],},..
}
this.defaultColDef1 = {
      flex: 1,minWidth: 150,filter: true,};

并且未显示按钮“清除”和“应用”过滤器:

enter image description here

解决方法

我尝试了您的情况。我所做的唯一更改是在HTML文件中使用了 ag-theme-alpine 的类名,而不是 ag-theme-mystyle 。试试看,您将看到您的按钮。enter image description here