Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set new column definition by setColumnDefs doesn't work anymore

I'm trying to set new column definitions by calling setColumnDefs using the grid API. This doesn't work as expected. The names of the column headers will not be updated anymore!

See this Plunkr: Version 19.1.x

Version 19.0.0 is latest working version.

See this Plunkr: Version 19.0.0

For me it seems to be a bug!?

In my project I'm using Angular 5 and I notice the same behaviour.

like image 627
Daniel C. Avatar asked Dec 03 '18 21:12

Daniel C.


1 Answers

I was able to reproduce your behaviour. The following (dirty) workaround works:

  gridOptions.api.setColumnDefs([]);
  gridOptions.api.setColumnDefs(newColDefs);

Setting the columnDefs to an empty array and then passing the newColDefs seems to achieve what you are looking for.

like image 90
Alexander Zbinden Avatar answered Oct 22 '22 20:10

Alexander Zbinden