how to dynamically set the row height and column width in ag-grid

安稳与你 提交于 2019-12-10 20:53:43

问题


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 
}


来源:https://stackoverflow.com/questions/35891835/how-to-dynamically-set-the-row-height-and-column-width-in-ag-grid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!