0
我正努力在订阅observable时刷新ag-grid。Observable订阅刷新ag-grid
我有以下一段代码,效果很好。
this.marketConfigs = this._regionProductConfigService.getMarketConfig();
this.gridOptions.columnDefs = this.createColumnDefs();
this.gridOptions.rowData = this.marketConfigs;
但因为我试图把在AG-格列下拉,我想列配置,一旦我们收到的数据被创建。所以我改变了以下代码:
this._refDataService.getAllCurrencies().subscribe(
(data: ICurrency[]) => {
this.financingCurrencies = data;
this.marketConfigs = this._regionProductConfigService.getMarketConfig();
this.gridOptions.columnDefs = this.createColumnDefs();
this.gridOptions.rowData = this.marketConfigs;
this.gridOptions.enableColResize = true;
this.gridOptions.api.refreshView();
},
err => console.log(err)
);
但它不显示任何东西在网格中。有人可以帮忙吗?
你可以检查是否有draw()方法吗?所以有点像this.gridOptions.draw() –
不,没有draw()方法。理想情况下,this.gridOptions.api.refreshView()应该强制网格重绘自己。 –