通过离开第一行 ag-grid 对行数据进行排序?
sort row data by leaving 1st row ag-grid?
我们如何避免对 ag-grid 的第一行进行排序?
我在网格中有 10 行的示例我只想通过离开 ag-grid 的第一行来排序 9 行?
我尝试了所有可能的代码并用谷歌搜索了一些示例,但没有成功
<ag-grid-angular style="height: 453px;"
class="ag-theme-bootstrap"
border-color="#FFFFF"
[enableSorting]="true"
[rowData]="serviceLineSurveyMaplist"
[pinnedTopRowData]="templateSurveyMapList"
[columnDefs]="mappedSurveyColumns"
[enableFilter]="true"
(gridReady)="onMapSurveyGridReady($event)"
[getRowStyle]="getrowstyles"
rowSelection="multiple">
</ag-grid-angular>
in ts file
this.serviceLineSurveyMaplist = result;
for (var i = 0; i < 2; i++) {
debugger;
this.templateSurveyMapList.push(this.serviceLineSurveyMaplist[i]);
}
我在 serviceLineSurveyMaplist 中有一些行我想固定
你可以使用 Row pinning feature
看看这个实例:https://www.ag-grid.com/javascript-grid-row-pinning/#example-row-pinning。尝试对任何列进行排序。
对于您的情况,只需使用 this.gridApi.setPinnedTopRowData(rows)
固定第一行。
根据documentation,固定行不支持排序,这符合您的要求。
我们如何避免对 ag-grid 的第一行进行排序? 我在网格中有 10 行的示例我只想通过离开 ag-grid 的第一行来排序 9 行? 我尝试了所有可能的代码并用谷歌搜索了一些示例,但没有成功
<ag-grid-angular style="height: 453px;"
class="ag-theme-bootstrap"
border-color="#FFFFF"
[enableSorting]="true"
[rowData]="serviceLineSurveyMaplist"
[pinnedTopRowData]="templateSurveyMapList"
[columnDefs]="mappedSurveyColumns"
[enableFilter]="true"
(gridReady)="onMapSurveyGridReady($event)"
[getRowStyle]="getrowstyles"
rowSelection="multiple">
</ag-grid-angular>
in ts file
this.serviceLineSurveyMaplist = result;
for (var i = 0; i < 2; i++) {
debugger;
this.templateSurveyMapList.push(this.serviceLineSurveyMaplist[i]);
}
我在 serviceLineSurveyMaplist 中有一些行我想固定
你可以使用 Row pinning feature
看看这个实例:https://www.ag-grid.com/javascript-grid-row-pinning/#example-row-pinning。尝试对任何列进行排序。
对于您的情况,只需使用 this.gridApi.setPinnedTopRowData(rows)
固定第一行。
根据documentation,固定行不支持排序,这符合您的要求。