Angular 6 - Add new row in AG Grid

后端 未结 4 1693
面向向阳花
面向向阳花 2021-01-05 00:46

I want to add a new element in AG Grid. I have a following model:

export class PersonModel {
  cars: CarModel[];
}

The AG Grid has as

4条回答
  •  别那么骄傲
    2021-01-05 01:25

    I visited ag-grid documentation and got rowData is simple array. If ag-grid not refreshing your dom then may be they want a fresh array. You can do like this:

    this.person.cars = [this.person.cars.slice(0), yourNewCarObj];
    

提交回复
热议问题