0
グリッドの最初の編集可能なセルにフォーカスを設定しようとしていますが、このエラーが発生しています "TypeError:未定義の 'setFocusedCell'プロパティを読み取れません。ag-grid ngOnInitでフォーカスされたセルを設定できません
私はag-grid-angularコンポーネントのngOnInitでsetFocusedCellを呼び出しています。ここでは抜粋です。
constructor(private mcService: MonteCarloService) {
this.gridOptions = <GridOptions>{
rowData: MCInputGridComponent.createRowData(),
columnDefs: MCInputGridComponent.createColumnDefs()
};
}
ngOnInit() {
this.gridOptions.api.setFocusedCell(1, "histDataType", null);
}
私は列を定義し、コンストラクタメソッド経由でいくつかのデータを設定しました。以下は列の定義です。
private static createColumnDefs() {
return [
{
colKey: "sprint#",
headerName: "Sprint #",
field: "sprint",
width: 80,
editable: false
},
{
colKey: "histDataType",
headerName: "Velocity",
field: "histDataType",
cellEditorFramework: NumericEditorComponent,
editable: true,
width: 102
}
];
}