How do I create a wide ag-grid without clipping or scrolling? - ag-grid

How do I make an ag-grid instance of arbitrary width, as determined by columns, without horizontal scrolling (on the element) and without clipping?
So, if I have 20 columns averaging 100 pixels wide, then the grid is 2000 pixels wide (and will make the BROWSER horizontal scroll appear). The grid will not have its own horizontal scroll and will not be clipped to whatever the browser width is.

Related

Swift - why elements don't have equal sizes?

I have a Vertical Stack View on my screen (Alignment = Fill, Distribution = Fill).
In it there are from top to bottom:
Label (no constraints)
Vertical Stack View (height=21)
Horizontal Slider (height=21)
Label (no constraints)
I was expecting that both my labels (elements 1 &4) will be of equal size and will occupy the majority of the screen and 2nd & 4th elements therefore would be in the center of the screen. But in reality my bottom Label's height is sufficient only to fill it's text while my top Label takes the majority of the space.
I tried to change the Distribution of my Stack View to Fill Proportionally, but in that case my top label becomes smaller than the bottom one.
Why is it happening? How can I make my Labels to become of equal height?
PS I noticed a warning about Content Priority Ambiguity but I can't figure out what should I do about it
To make both labels equal in height I had to select both of them and add a constraint Equal Heights.
Warning about Content Priority Ambiguity was not about them, it was about horizontal labels. To remove warning while keeping their placement I changed Distribution of the horizontal Stack View to Equal Centering.

How to adjust the width of the ag-grid container based on its contents?

In ag-grid, the value of domLayout can be set to autoHeight in order to disable vertical scrolling of the ag-grid panel. Instead, the entire page adapts its height to show all the rows.
How can I have the same behavior for the horizontal scrolling?
There is the suppressHorizontalScroll option when set to true hides the horizontal scroll bar, but this doesn't force the entire page to have a scroll. Instead, the overflowing content is just hidden.
you can do this to some extent by juggling the minWidth, maxWidth, and width attributes on your columns while setting the width of the columns automatically based on their content using the gridColumnApi.autoSizeColumns(colId) method.
I say to some extent because it is quite hard, with agGrid, to set different row sizes for rows with certain cells having a lot of text or big images in them. This would force some columns to expand to accommodate for the content, or just clip it completely. Thus forcing the horizontal scroll.
Note : for the method above to work, you need to call gridColumnApi.autoSizeColumns(colId) after you get your rows setUp.

Unity list item is leaving extra space in high resolution

I have a vertical Scroll List. I have developed this app for resolution 768*1024. In this resolution my List is working fine. But when I run my app in higher resolution(1440*2960) it leave some space around all 4 direction.
I have also tried with changing Layout element min height dynamically, but Spacing issue is still exist.
Vertical and horizontal layout set element position in (screen width/height divided by a number of elements) * element number, in other words, they space out all elements evenly across canvas space. To achieve what you want you either have to enable child control size -> height option or write a script that aligns your elements in the center of the screen and one after another taking in consideration their height.

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.

GWT widget on bottom without knowing height/size

I want to have a two widgets to stack up
X
Y
I want Y to take up as much height as it needs (its static in size, roughly 50px depending on browser font, etc) and remain affixed to the bottom of the screen, and X to take the rest of the vertical space.
X happens to be a scrollpanel with VerticalPanel and more inside, Y is a Grid and I've tried putting them in various containers, but they all seem to want a size for Y (ie. DockLayoutPanel & LayoutPanel). If I specify a size for Y it ends up with white space at the bottom on one browser or another. Any advice?
It's just not possible in HTML/CSS. If you absolutely cannot know the height of Y in advance, the way around it would be to:
Attach this widget somewhere off-screen
Measure it's height using yWidget.getOffsetHeight()
Remove it
Add it to your LayoutPanel and setting the 'bottom' coordinate to 0 and 'height' to the measured height.