ag-grid column headers will not resize by dragging - ag-grid

I have copied the code column definitions and all attributes pertaining to resizing columns from the ag-grid examples for re-sizing columns in ag-grid vue, however I cannot resize my columns... the cursor will not even change to the "arrow" when I hover over the left or right edges of the columns.
Has anyone ever run into this?

If you are using ag-grid version 19.1.2 you can enable column resizing by setting [enableColResize]=true to ag-grid component

Related

Ag Grid pass column width in column definition

I am using Ag Grid with React. I have a page with a dropdown which renders different tables according to the dropdown choice.
Some columns of these tables have content that overflows their width. To deal with this, I have a custom tooltip implemented, which displays the full text content on hover.
The issue is that since I have multiple tables inside a single page, the column widths of my target columns keep changing. I want to pass the column width of the target column as props to cell renderer component in colDef so that I can compare the columnWidth and the text scrollWidth to decide if the text overflows. Let me know any leads for this.

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 to fit with column to content

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()

disable drag and drop on fixed columns in gxt

i have a that grid consists of 3 columns. The first and third columns have fixed width but the middle is auto fit. What i want is to disable drag and drop on fixed columns so their positions in grid wont change ... any help for this ???
You can set the column to be fixed on the ColumnConfig using columnName.setFixed(true)

gtk treeview column resizing and horizontal scrollbar

I have a gtk treeview (inside a GtkScrolledWindow) with two columns.
If I set both columns to the default sizing policy, I have a horizontal scrollbar for the treeview but the columns can't be sized down by the user, which is impractical.
If I set both columns to setSizing Fixed, fixed width 120, I get a nice display and the columns can be resized, but there is no horizontal scrollbar in the treeview (since the columns size down to fit in the width of the treeview I guess).
If I set the first column to setSizing fixed, fixed width 120, the second one to automatic, only the second column is displayed (???).
I would like that by default the first column takes let's say at most 60% of the display, the second column can go all the way and I have a horizontal scrollbar. Certainly I want the user to be able to resize them up or down, not as with the default policy, that you can resize them down!
That's why I tried the first column fixed, the second automatic, it was promessing but I don't understand why the first column is not displayed at all in that configuration.
I add the cell renderers with packstart true, I tried false but it didn't change anything, also I tried setting the expand for the columns to true or false, which didn't have any effect.
Note I'm using the gtk2hs haskell bindings but I'm certain it would be the same in any other gtk binding. Just mentioning if people will ask for code samples.
I'm pretty sure this is a common problem... I'd say nautilus is fixing it the way I'd like to fix it, but I think digging in the nautilus source is going to be quite long...
EDIT well i've discovered the cell renderer's ellipsize setting also has an effect. Setting it to end for the first column and none for the second should be what i want but then the first column is very small and cannot be expanded through resize...
EDIT2 well for now i've moved to word wrapping for the cell renderer, that way i don't have to bother with a horizontal scrollbar... Still curious for the solution to that question though.