how to dynamically set the row height and column w

2019-07-06 18:09发布

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条回答
仙女界的扛把子
2楼-- · 2019-07-06 18:33

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 
}
查看更多
登录 后发表回答