【发布时间】:2017-04-25 01:08:17
【问题描述】:
我被困在这个网格上,我没有看到我尝试每个示例的错误,但它对我不起作用!
我的问题是设置网格适合行内容这是我的 gridoptions 版本
this.gridOptions = {
pagination:true,
enableColResize: true,
animateRows: true,
};
this.gridOptions.columnDefs = [
{
headerName: "Account ID",
field: "AccountID",
minWidth: 100
}, ... ]
this.gridOptions.onGridReady = () =>
{
this.gridOptions.api.sizeColumnsToFit();
this.setRowData();
}
当用户单击按钮时,网格必须应用此新更改
resizeWind()
{
this.gridOptions.api.forEachNode(rowNode => {
if (rowNode.data) {
rowNode.setRowHeight(100);
}
// console.log(rowNode.data);
});
this.gridOptions.api.onRowHeightChanged();
}
注意事项 - 通过 angular-cli 使用 webpack 的 Angular 4
【问题讨论】: