Vaadin Grid autoheight for cell - vaadin

in my Grid a have a cell with long text .
Automatically Grid makes width:auto and I get very wide cells.
I want to make this cells more "readable" for user with
.dashboard .v-grid-cell{
word-wrap:all;
height:auto;
}
It takes no result ((
And I don't want to make all rows with same height, height or each row must be dependable of height of this cell.
You hope my question is clean ))

Grid in Vaadin 8 and Vaadin 7 does not support rows being of variable heights. So unfortunately answer is no.
In latest versions of Vaadin Platform 10 and newer there is totally new implementation of Grid, which however supports variable row heights.

Related

Vaadin 8 grid row height is not automatically adjusting

I am working on the grid component in vaadin 8. In My grid, each column data fetched from the database and it may be too lengthy. the grid row height is not expanding based on the content in each column. My grid is given below.
You can see complete content is not visible in each columns.
In Vaadin8 the Grid component rows are not auto-adjusting, i.e. this feature does not exists there. The Grid rows are of fixed height. There is an API to configure the row height e.g. grid.setRowHeight(50).
This limitation no longer exists in the newer generation Vaadin frameworks, e.g. Vaadin 14.

Correctly wrap text in tableview cell

I want to ask if anybody have solution for this kind of problem:
I have Tableview with dynamic cells, they have two labels and dynamic height. When the data is set to label, text in label is splitting in to new rows in the middle of word.
I tried set line breaking to word wrapping
In other tableviews with dynamic cell height I have no problem with splitting text
Labels have constraints to top, bottom, left and right of content view
Newest Xcode version and iOS > 13.0
Thanks for any help!
I download your demo and tried the same settings in English Language and it worked perfectly , so it seems a bug for me in Xcode for me ..

How to set Row height dynamically in vaadin 7 Grid?

I'm creating a vaadin grid with three columns of which one column is having HTML contents. HTML data can be in multiple lines. By default only first line of HTML Data is getting displayed in the Grid.
Below is my code
Grid grid = new Grid();
grid.setColumns("C1","C2","C3");
grid.getColumn("C1").setHeaderCaption("Column 1");
grid.getColumn("C2").setHeaderCaption("Column 2");
grid.getColumn("C3").setHeaderCaption("Column 3");
grid.getColumn("C2").setRenderer(new HtmlRenderer());
grid.addRow("text1","<p>Line 1 Data</p><p>Line 2 Data</p>","data1");
grid.addRow("text2","<table><tr><th>Month</th><th>Savings</th></tr><tr><td>January</td><td>$100</td></tr></table>","data2");
And the grid looks like this
How to set the height of rows dynamically based on height of the HTML Data?
I'm using vaadin 7
How to set the height of rows dynamically based on height of the HTML Data?
This feature is not supported in Vaadin 7 or Vaadin 8 Grid. The Grid is based on fixed height rows. In Vaadin 7 you can set the Grid height in your theme (see more info here: https://vaadin.com/forum/thread/14385724), in Vaadin 8.1+ there is also setRowHeight() method in Grid.

Clarity: Is there a recommended way to make clr-datagrid take up all available vertical space?

I am trying to make my take up all vertical space even if there are no rows in the table yet. Is clr-datagrid customizable to do so? It seems like I have to manually override flexbox properties of .datagrid-host and .datagrid-overlay-wrapper in order to make it grow in column direction.
I tried even that but the datagrid don't seem to be growing vertically.
The Clarity datagrid supports any fixed height you want on the datagrid element itself. If the height is too large for the number of displayed rows, the body will expand with empty space. If the height is too small for the number of displayed rows, the body will scroll while the header and footer remain in place.
So in your case, it's as simple as putting height: 100% for the datagrid in your CSS. That's all you need to do. See https://plnkr.co/edit/eZqaic8CS6CFHVcGxAnH?p=preview for a working example.

How to keep auto-sized table cells format consistent after edition/deletion of rows using UIKit?

I have a simple table view with a unique label for the cell prototype. I have been following the recommendations in order to have proper auto-sizing cells:
setting auto-layout constraints for the label regarding its leading, trailing, top and bottom spacing in its content view,
setting the rowHeight property to UITableViewAutomaticDimension,
providing the estimatedRowHeight property (set to 44),
setting the number of lines for the label to 0.
I also have enabled the default Edit Mode which allows the reordering and deletion of rows (exactly like in the Alarm tab of the Apple Clock app).
Now, on to observed problem:
I provide two labels, one with a short text and a second with a longer text, so that the second row has twice the height of the first row.
I enter Edit Mode, and swap the position of the rows. So far, everything keeps its composure and the sizing is still correct, the longer label being in the top row.
When I swap the positon again to return to the original layout (short label on top and long label on bottom), the longer text is not spread over two lines in its row as it should, but turns into a one-line display with an ellipsis at the end. Moreover, the height of the cell remains the same and does not fit the now single-lined text.
And after exitting Edit Mode (compare with the first image):
I suspect that I might be missing some kind of reload operation after the moving or deletion of rows, but I did not find the relevant information. Similar sizing problems appear when deleting rows that have been previously reordered.
How to keep the cell sizing as well as the text formatting consistent after moving/deletion of rows?
Thank you very much.

Resources