Right align ComponentRenderer in a Vaadin TreeGrid - vaadin

It is possible to align text content in a Vaadin TreeGrid column using setTextAlign(ColumnTextAlign.END), however this does not work if the column is using a ComponentRenderer, in my case it is rendering a MenuBar component.
Does anyone know if it is possible to right align a ComponentRenderer without resorting to a template or wrapping it in a HorizontalLayout?

Related

How to use Ant Design custom scrollbar outside of select?

Antd uses custom scroll bar in selects. Is there any way to replace default Windows scrollbar with it in other Ant scrollable lists and tables?

Alignment of Vaadin custom fields

I'm trying to create a delete button that fits nicely into a Vaadin form (and maybe in the future even more custom fields). I can't seem to get the alignment correctly. How should this be done properly?
See click me button in:
https://vaadin-example-cknsvo.stackblitz.io
https://stackblitz.com/edit/vaadin-example-cknsvo?file=views/engatta-app.ts
If you wrap those elements with a flexbox, such as a vaadin-horizontal-layout or just a div with display:flex they will align vertically.

Vaadin Flow 23 - resizable text area

I'm building a page to enter a blog using Vaadin Flow 23.
Using TextArea I need to either expand the TextArea to fill the available space or make it so the user can resize the text area by clicking the bottom right-hand corner and dragging (or similar).
The problem is that I'm using the TextArea inside a FormLayout.
The FormLayout doesn't support 'expand()' or similar and the TextArea lacks the bottom corner drag point we see in many text editors.
I can't remove the FormLayout but am otherwise open to suggestions.

Vaadin chart not using up correct width

In Vaadin 14.6.1, I have created a horizontal layout with 2 charts (and some other stuff). The charts are not using up the correct width -- they seem to not "pick up" on the right width (see screenshot below). I set the width to 100% etc. Also, this problem disappears if I use a simpler component, such as label, instead of charts (from Highcharts). I've experienced a similar problem before, but in more complex settings (e.g. a user adjusts the splitlayout and the underlying chart does not resize). But in this case, it's an even more reasonably straightforward scenario (i.e. no adjustment by user of the width of any layout) and yet Vaadin doesn't seem to pick up the right width, at least when using charts. Is this a known or reproducible issue? If so, any workaround?
Charts indeed behave badly with some layouts. I have noticed two cases. The other is the Board component, where the workaround is just simply wrap Chart inside Div, i.e.
Div div = new Div();
div.add(chart);
// and then add div to Board
SplitLayout is more tricky. You need to call Chart to reflow after splitter has been moved. Something like the following finds all the charts and forces them to redraw.
splitLayout.addSplitterDragendListener(event -> {
getUI().ifPresent(ui -> ui.getPage().executeJs(
"Array.from(window.document.getElementsByTagName('vaadin-chart')).forEach( el => el.__reflow());"));
});
Note, if you have only one chart or have conveniently the references to chart instances you can do
chart.getElement().executeJs("$0.__reflow();", chart.getElement());

How resize a cxgrid with the mouse?

I have 4 cxgrid into a cxTabSheet, 3 aligned albottom and 1 aligned alClient...
When the mouse is over the edge of any cxgrid, the cursor mouse doesn´t change to the crSize(NS, WE, NESW, NWSE) and cannot select the border of grid for drag the mouse and resize it.
How can I do this?
The easiest way to do this, without writing any code, is to use one or more splitters on your form: see TSplitter and the Devex custom version, TcxSplitter, in the online help.
To use, place one or more splitters on the form orientated to allow resizing of the grid(s) as you wish, then place the grids on the appropriate areas of the splitters, or on panels on the splitters. One splitter can be placed inside another, so that you can have one resizable area inside another.

Resources