0

I set forceFitColumns: false to user can to set any columns width

gridOptions: {
  forceFitColumns: false,
  enableAutoSizeColumns: false
}

1.Set any columns width enter image description here

but if user would like to set ForceFitColumns, then grid fit to window. Next if i refresh grid, I can't see option to set forceFitColumns to true. I would like grid to remember that ForceFitColums option (maybe in Preset?)

  1. Click Force fit columns enter image description here
  2. Refresh grid enter image description here
  • your question is really hard to understand, Angular-Slickgrid by default uses `autosizeColumns` when loading the page (but only once not after), this will effectively try to fit all columns into the grid as much as it can, unless you disable `enableAutoSizeColumns`. The `forceFitColumns` also uses internally `autosizeColumns` but it keeps it enabled at all time and I personally hate that, which is why I use `autosizeColumns` only once (on page load). `forceFitColumns` can be enabled in the grid options and also through the Column Picker & Grid Menu. – ghiscoding Jun 01 '20 at 02:02
  • Let's say I try to save flag forceFitColumn in localStorage, but I can't to find event on click forceFitColumn or what is command name on click forceFitColumn?. – Przemyslaw Widanka Jun 01 '20 at 11:02
  • There's no event, it's just a flag, it's not a method. To know which events exist, you can take a look at the core library code [here](https://github.com/6pac/SlickGrid/blob/master/slick.grid.js#L5769) – ghiscoding Jun 01 '20 at 17:22
  • Also just to be more specific, you can call `autosizeColumns` at any time you want, that is basically what `forceFitColumns` uses internally. – ghiscoding Jun 02 '20 at 12:54

0 Answers0