我很好奇如何以打字的方式使用农业网格,角度和打字稿。
在示例中,我看不到任何类型定义的用法,例如在使用columnDefs,回调(gridReady,firstDataRendered)或valueGetter函数等时……
答案 0 :(得分:1)
您看过documentation和repo吗?
columnDefs
ColDef
它太大而无法复制,只需检查ColDef
内的ag-grid/packages/ag-grid-community/dist/lib/entities/colDef.d.ts
界面
gridReady
AgGridEvent
export interface AgEvent {
type: string;
}
export interface AgGridEvent extends AgEvent {
api: GridApi;
columnApi: ColumnApi;
}
firstDataRendered
FirstDataRenderedEvent
export interface FirstDataRenderedEvent extends AgGridEvent {
firstRow: number;
lastRow: number;
}
valueGetter
ValueGetterParams
export interface BaseColDefParams {
node: RowNode;
data: any;
colDef: ColDef;
column: Column;
api: GridApi;
columnApi: ColumnApi;
context: any;
}
export interface ValueGetterParams extends BaseColDefParams {
getValue: (field: string) => any;
}