Vaadin 14.4.0 Grid recalculate column widths after column is sorted

Hello,

is it possible to recalculate column widths after column is sorted.
The following code is not working. I guess the listener is fired before sorting is done and the data is repainted in grid…

	addSortListener(l -> {
		recalculateColumnWidths();
	});

Best
Jan

Could be related to this issue: https://github.com/vaadin/vaadin-grid/issues/1864

Tanks for your reply!
Yes, something like this. But i need to fire recalculateColumnWidths(); after the sorting is done.

You could try the workaround mentioned in ticket:https://github.com/vaadin/vaadin-grid/issues/1864#issuecomment-705546421

Thank you! It works perfectly! This is the code inside my Grid

		addSortListener(l -> {
			Page page = UI.getCurrent().getPage();
			page.executeJs("$0.$server.recalculateColumnWidths()",getElement());
		});

and

	@Override
	@ClientCallable
	public void recalculateColumnWidths() {
	        super.recalculateColumnWidths();
	}