Angular 按钮中的 Ag Grid Clear 和 Apply in filters 不可见
Ag Grid in Angular buttons Clear and Apply in filters aren't visible
我有一个带有从 angular 网页示例中复制的过滤器的 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,
};
并且未显示按钮“清除”和“应用过滤器”:
我试过你的场景。我所做的唯一更改是 class ag-theme-alpine 的名称而不是 ag-theme-mystyle 在您的 html 文件。试试这个,你会看到你的按钮。
我有一个带有从 angular 网页示例中复制的过滤器的 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,
};
并且未显示按钮“清除”和“应用过滤器”:
我试过你的场景。我所做的唯一更改是 class ag-theme-alpine 的名称而不是 ag-theme-mystyle 在您的 html 文件。试试这个,你会看到你的按钮。