How to disable the possibility of dragging columns (headers) and avoid to change they width, I want to do this because as documentation says:
The user can resize columns by dragging their separators with the mouse. When resized manually, all the columns widths are set to explicit pixel values, even if they had relative values before.
Once a column is resize, the Grid loses the auto-width-adjustment and the Grid gets a gap in the right size. I couldn’t find a way to rollback the state of the column width without reload the GUI
Thanks, Idk how I missed setResizable().
I am trying now the add-on but doesn’t seems to work. Grid should (or not) has some kind of setting to make this extension works? The grid is in a VerticalLayout, which is setSizeFull() too
I have the following column setting:
1st .setHidden(true);
2nd .setResizable(false).setSortable(false).setMaximumWidth(100).setExpandRatio(1);
3rd and 4th .setSortable(false).setExpandRatio(3);
5th .setResizable(false).setSortable(false);
I just added: new GridScrollExtension(grid).setAutoResizeWidth(true);
I cloned your example from github (branch vaadin8), but the autoResizeWidth is not what I expected, it shrinks the Grid while a column lose width, it doesn’t make others columns to take the “available” space. Sorry if I misunderstood what the add-on suppose to do
it doesn’t make others columns to take the “available” space
I had three options in my original answer, the second should do what you are looking for, i.e. : “Alternatively you should be able to set all columns to undefined width, after which auto-width-adjustment of the columns happens again when you call Grid.recalculateColmnWidths().”