diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-08-01 11:01:11 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-08-01 11:01:11 +0300 |
commit | 95087a8482c0271a2d01881bc560d9b28600617d (patch) | |
tree | c2af5f77285cc807661cb61fdbb01d84995518fd /server/src/main | |
parent | 921cd76504ed3045492b69285b8100fecb842abd (diff) | |
download | vaadin-framework-95087a8482c0271a2d01881bc560d9b28600617d.tar.gz vaadin-framework-95087a8482c0271a2d01881bc560d9b28600617d.zip |
Add API for forcing Grid column width calculation (#9756)
This feature was present in Vaadin 7 but missing from Vaadin 8
Diffstat (limited to 'server/src/main')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/Grid.java | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 141130b7a2..dbaff46181 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -403,11 +403,12 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, * * <p> * Usage: + * * <pre> * grid.addContextClickListener(event -> Notification.show( - * ((GridContextClickEvent<Person>)event).getItem() + " Clicked") - * ); + * ((GridContextClickEvent<Person>) event).getItem() + " Clicked")); * </pre> + * * @param <T> * the grid bean type */ @@ -2766,6 +2767,19 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, } /** + * Requests that the column widths should be recalculated. + * <p> + * In most cases Grid will know when column widths need to be recalculated + * but this method can be used to force recalculation in situations when + * grid does not recalculate automatically. + * + * @since 8.1.1 + */ + public void recalculateColumnWidths() { + getRpcProxy(GridClientRpc.class).recalculateColumnWidths(); + } + + /** * Sets the details component generator. * * @param generator @@ -3396,8 +3410,8 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, * happens. * * @param listener - * the context click listener to add, not null - * actual event provided to the listener is {@link GridContextClickEvent} + * the context click listener to add, not null actual event + * provided to the listener is {@link GridContextClickEvent} * @return a registration object for removing the listener * * @since 8.1 @@ -3405,7 +3419,8 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, * @see Registration */ @Override - public Registration addContextClickListener(ContextClickEvent.ContextClickListener listener) { + public Registration addContextClickListener( + ContextClickEvent.ContextClickListener listener) { return super.addContextClickListener(listener); } |