How to fit with column to content - ag-grid

I need to fit the column width to the content of the column and allow scrolling horizontally.
I am using ag-grid with JavaScript
exist a way to do this? I always fund example using gridOptions.api.sizeColumnsToFit() but this will fit to the grid.
any help link?

Use columnApi.autoSizeColumns() not api.sizeColumnsToFit()

Related

Is the following structure possible with "wrap" in flutter?

These boxes will basically be images of unknown resolutions. I want them to fit in such wrap structure that they are put one by one from left to right, but if there's more space in right column then the image should be placed in the right column instead of the left one.
I was wondering if this is possible with "wrap" widget, I tried it and couldn't get it to work without having to set a fixed height and wrap alignment to vertical. But I can't have a fixed height because there will be unknown number of images.
If nothing works, I will have to have a custom solution using columns or rows and I can do that but I just want to know if there's a simpler way to do this. Thank you in advance!

Intrinsic Height Issue in row

I want to have three children in a row.
First child on the top.
Second child will have dynamic height according to the data in a column
Third child needs to be in center of regarding the height of the second child.
I was using Intrinsic height to achieve this but when the second size increased with data it gave overflow issue. Because it wasn't allowing the column in 2nd child to take as many height it needed. Any alternate solution for intrinsic height?
Any help would be great! The design I want to achieve is attached.
Recently Flutter released this video: https://www.youtube.com/watch?v=Si5XJ_IocEs
Since you mentioned in the comments that your code can be considered a simple Row widget, I think the video has the answer to your problem.

Desktop flexible grid amount of content in a row

I have problem designing inside a flexible a grid where it can go from 3 item in a row on full screen to be 1 item in a row on the smallest allowed size of the application, is there a widget or guide for this?
use ResponsiveGridList from the package https://pub.dev/packages/responsive_grid.
It is simple and well documented. I used once already, it fitted my needs perfectly.

How to achieve auto width Column in sap.ui.table.Table?

I am using sap.ui.table.Table. This table has some very good feature but I am having a tough time to figure out how to set the column to auto width.
Currently, all the columns are fixed size but I want something if column A value is small, then auto adjust it rather than having fixed size. Same for if the column value is large, then adjust it to show the value.
I saw the other question sap.ui.table.Table how to optimize column widths but the answers there are to get column layout with fixed sizes, not auto width.
The control sap.ui.table.Column offers a property called autoResizable by which the user can resize the column width depending on the content of the column's template.
<Column
autoResizable="true"
...
From API Reference:
Enables auto-resizing of the column on double clicking the resize bar. The width is determined on the widest currently displayed content. It does not consider rows which are currently not scrolled into view.
However, as you can see, it requires user interaction. Doing it without user interaction programmatically can be achieved by using the (currently experimental) API autoResizeColumn from sap.ui.table.Table.
myTable.autoResizeColumn(/*ColumnIndex*/); // experimental!
Here is an example of both approaches: https://embed.plnkr.co/NQpkJo/.

How can I force a ListBox to fill entire free area?

I put a ListBox into a tabele cell an want it to ocupy the whole cell (width="100% height="100%") and show as many rows as possible but:
not specifyng setVisibleItemCount causes to show a big dropdownbox (i want a list)
specifying setVisibleCout makes listbox to ignore height (it takes as much place as it needet to exacly display n rows)
i there a workaround ? (in Swing a number of wisible rows ia a funcion of height and I'd like it this way in gwt).
Thanks in advance
ListBox is a native GWT component, and that's the way it works. If you're using GWT 2.1 you can create your own CellRenderer
You could approximate a solution by calculating how many items should be shown based on the height you want.