How can we change the row height base on a condition in Nebula NatTable? - nattable

I want to change the row height of some rows. How can we do it? Can you give me some guide?

To set the row height to a fixed value, e.g. double the height of a specific row, use the DataLayer API.
dataLayer.setRowHeightByPosition(0, 40);
If the row height should be set automatically to match the content, configure the TextPainter for row height calculation using the appropriate constructor.

Related

Infinite row model - Auto Row height

I'm using infinite row model type for few grids and I need the row height to be set based on the cell content(Auto Height). Can you please help me with this.
When I try setting height using node.setRowHeight(height), api.onRowHeightChanged(), the height is not getting set for infinite row model.

GWT DataGrid resizes the columns

From what I understand the DataGrid auto resizes the columns.
What I would like is DataGrid to respect the column widths I set, and to show the horizontal scrollers accordingly. Is there a way to achieve this?
DataGrid gives you complete control over the width of its columns.
For example, if you set the width of all columns in pixels except for one column which has a width equal to 100%, then all columns will have exactly the width you specified, except for the percentage column which will shrink or expand based on the width of a DataGrid itself. If you want all columns to have fixed width, then you should set the width of the entire DataGrid explicitly in pixels.
There is also an important .setMinimumTableWidth method. You can use it to tell the DataGrid that it can resize with the width of its parent container, but never be smaller than a certain number of pixels. In this case, if a parent container is too small to accommodate all columns at their desired width, the horizontal scrollbar will appear.

itext -- How do setMinimumSize() and setFixedSize() interact?

Is it well-defined in iText to call setMinimumSize(15) on some cells in a row, and setFixedSize(15) on the other cells of the same row?
What I would like is for iText to increase the row height to accommodate the text in the cells whose minimum height is set, while letting text in cells set to a fixed height clip. Is that what iText does?
If not, how do I achieve this? Thanks.
While we're at it, am I correct that calling neither setMinimumSize() nor setFixedSize() is equivalent to calling setMinimumSize(0) -- iText makes the cell as tall as it needs to be to accommodate the text?
This is with iText 2.1.6.
I already explained in a comment that setFixedHeight() always gets preference. If you use setMinimumHeight() and setFixedHeight() in the same row, and you define a minimum height along with a fixed height, the fixed height prevails.
if the minimum height is set to 30pt and the fixed height is 60pt, the height will be 60pt, no matter how much content is added to the cell.
if the minimum height is set to 60pt and the fixed height is 60pt, the height will be 60pt, no matter how much content is added to the cell.
if the minimum height is set to 120pt and the fixed height is 60pt, the height will be 60pt, no matter how much content is added to the cell.
If different fixed heights are defined, the highest value is taken. For instance: if you have a row where one cell has a fixed height (e.g 120 pt) that is higher than the fixed height of another cell (e.g. 60 pt), then the highest value (in this case 120) prevails.
You claim that this isn't mentioned in the book I wrote. Please note that the book counts about 600 pages. A lot of text I wrote was edited away by the publisher. Otherwise the book would have been a thousand pages and more.
You could have written a small test example, such as the FixedHeightCell example. Please take a look at the resulting PDF. In row D all the cells have a fixed height of 60 pt. In row E, most cells also have a fixed height of 60, but the cell in column 4 has a fixed height of 120, hence the height of the row is 120. Then there's row F, with a fixed height of 60 pt and a minimum height of 120 pt. Although we add text that doesn't fit the cell in column 2, the content is truncated.

CellList: How to set row height dynamically?

I have a CellList which will have fix number cells in one page, i would like the cells extend to fill the whole CellList.
Suppose the CellList height is 100px, the cell number is 10, then one cell/row will be 10px, if the CellList height is 500px, each cell/row's height will be 50px.
The problem is, how to control the row height after table rendered, i tried to addLoadingStateChangeHandler on cell list and when onLoad i use GQuery to resize the cell height, but seems no effect.
Yes i can get each row's height beforehand, but how to apply to the CellList's CSS?
Any ideas on this?
Problem solved, when creating a new cell, specify its height(because we know the height beforehand), when resizing the CellList, just redraw it by specifying a new height.

JasperReports: set textfield height to height of other element in band

I have several textfields on a single row in the same band. The first of them is having a larger font than the rest. However, the size of this font might change for each record. How can I set the height of the other textfields to be dependant of the height of the first one?
Thanks for your help,
Andreas
On each field in the row set Stretch Type to be Relative to Tallest Object.