Hello, I have a list grid which has autoFitData set to vertical and AutoFitMaxHeight set to 400. After the grid is drawn, I'd like to disable the autofit so that the user can vertically resize the VLayout which contains the grid, because it seems that the grid autofit is preventing the resize behavior of the parent VLayout via drag and drop. However, if I disable the grid's autofit after it is drawn, the grid goes back to the default height of 100. Is it possible to disable autofit and keep the grid height the same? If not, is there any way to maintain the autofit and allow the parent VLayout to be resized with drag & drop? Thank you.
Announcement
Collapse
No announcement yet.
X
-
Originally posted by Isomorphic View PostNormally you would just setHeight() to the grid's current height before disabling autofit - did you already try that and have trouble with it?
This is my code:
Code:columnsGrid.addDrawHandler(new DrawHandler() { @Override public void onDraw(DrawEvent event) { int height = columnsGrid.getHeight(); int width = columnsGrid.getWidth(); BCUtils.logToSC("width is: " + width + " height : " + height); //This prints out the height as 100, even though it's actually around 400 due to the grid being autofitted to the max autofit height // columnsGrid.setAutoFitData(null); // columnsGrid.resizeTo(width, height); }}); columnsGrid.setAutoFitData(Autofit.VERTICAL); columnsGrid.setAutoFitMaxHeight(400);
Comment
-
Thank you, that helped me quite a lot. Also the resize behavior was not prevented by the grid's autofit - it was actually because I had my layout containing the grid set to Overflow.VISIBLE. So getting the layout's visible height (after everything is resized due to the grid's autofit) and then changing it to hidden overflow and setting the height to the previous resized height makes it work correctly.
Comment
Comment