I have used using this trying to fit the column and row width how to dynamically set the row height and column width in ag-grid(please provide git hub code in typescript)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I am assuming that you want to set row height based on the content of a row.
step 1 : set getRowHeight property to a javascript function.
gridOptions.getRowHeight = rowHeightFn
step 2 : define rowHeightFn based on your requirement.
function rowHeightFn(params) {
var result = 46;
if (params.data.someKey === 2) {
result = 2;
}
return result
}