Upgrading to ag-grid-community / ag-grid version 19
With our new release of version 19 of ag-grid, you may need to make some changes to your imports and package files.
ag-grid has been replaced with ag-grid-community
your package json will need to have ag-grid (deprecated version) removed, and replaced with ag-grid-community.
All versions of enterprise, or any framework variants will need to also match the version of community (19)
your packages inside of package.json should look something like this.
{
"ag-grid-community": "^19.0.0",
"ag-grid-angular": "^19.0.0",
"ag-grid-enterprise": "^19.0.0"
}
Delta columns
From v19.1.0 delta columns are available, this means that now you can change the column definitions dynamically without causing the grid to reset.
Note that this feature is still being polished and we are thinking about possibly changing the way it works, but for the time being the key points are:
1- If you want to update some existing columns, DON'T do it through setColumnDefs. Instead get a reference to that column, change it any way you want and then call refreshHeader
https://www.ag-grid.com/javascript-grid-column-definitions/#changing-column-headers
2.- If you want to add or remove columns, then you need to call setColumnDefs, note that changes to already existing columns passed here are not going to be picked up, but new or removed columns will be deleted from the grid
https://www.ag-grid.com/javascript-grid-column-definitions/#column-changes
As mentioned above, we are considering consolidating the setColumnDefs as the golden source of truth, the investigation that we are carrying for this is tracked with this issue:
AG-2289
Delta Columns - Investigate if it we should consider setColumnDefs as the golden source for delta columns.
Column menu/Context menu not showing/misplaced
In v19.1.2 we introduced a new way of attaching our menus to the screen, which in most cases will enhance the positioning of them
Unfortunately, this breaks the positioning in some cases if you are laying out your grid in containers that have 0 height or padding at the top.
This is tracked with two tickets at the moment:
AG-2315 When adding padding to the top of a grid or one of the outer containers has 0 height causes the positioning of any popup (context menu/column menu) to be off
AG-2203
popupParent option doesn't correctly position columnMenus/contextMenus/popup editors on small grids
We will shortly release 19.1.3 which will include fixes for both issues
As a workaround for the meantime, there are 2 possible solutions
1) Reposition the popup manually
postProcessPopup: (params) => {
params.ePopup.style.top = (Number(params.ePopup.style.top.replace ('px', '')) + 450) + 'px';
},
(You will need to change the 450 to something adequate on your end)
2) Change popupParent in your gridOptions to document.querySelector ('.ag-root-wrapper')
Please ping us in support if these workarounds are not fixing this issue for you.
Issues with popup editors introduced in 19.1.0
We are investigating some issues introduced in 19.1.0 with popup editors, for instance, material editors in angular in popup mode seem to be broken at the moment
This is all investigated as part of the following JIRA
AG-2359
Investigating issues with popup editors not working anymore (ie Angular Material editors)
Our recommendation is to stick to 19.0.0 where possible, if not, please contact us in support.
We will fix the issue in our next 20.x release ETA early 2019
Comments
3 comments
Hi,
How about IQueryGridRequest , iEnterpriseDatasource, IQueryGrid .... ?
Could you please provide us all changes on modules import ?
thanks & regards,
Nacim
When are we going to be able to get rid of ag-grid-community if using enterpise? The themes are still in communiy so we cannot presently.
Hi I have upgraded all ag-Grid versions from 18.0 to 20.0, But now my entire existing grid structure it self gone. What need to be change according to new versions. You can see in img's before and after updation of the grid.
Please sign in to leave a comment.