Page 1 of 1

Data Grid with variable row height.

PostPosted: Fri Sep 08, 2023 1:05 pm
by swingman
Hi all,

On older versions of NG-Client I have been using the column grid-option autoHeight: true and CSS to wrap text and get the grid to increase the row height where needed so all the text shows.
On Servoy 2022.12 autoHeight is no longer recognised.

Code: Select all
WARN org.sablo.BrowserConsole - ag-grid: invalid gridOptions property 'autoHeight' did you mean any of these: gridAutoHeight,headerHeight,rowHeight,getRowHeight,groupHeaderHeight,pivotHeaderHeight,detailRowHeight,pivotGroupHeaderHeight
WARN org.sablo.BrowserConsole - ag-grid: to see all the valid gridOptions properties please check: https://www.ag-grid.com/javascript-grid-properties/


Now I can't get this to work. What is the new way of doing this?

Thanks

Re: Data Grid with variable row height.

PostPosted: Fri Sep 08, 2023 1:27 pm
by rafig
Does changing it to
Code: Select all
gridAutoHeight

work (it's one of the options in your error...)?

Re: Data Grid with variable row height.

PostPosted: Fri Sep 08, 2023 1:42 pm
by Gabi Boros
you said "have been using the column grid-option autoHeight: true", but according to the error "invalid gridOptions property autoHeight" you're adding this property now wrongly to gridOptions instead of the columnDef?

Re: Data Grid with variable row height.

PostPosted: Fri Sep 08, 2023 2:01 pm
by swingman
Gabi Boros wrote:you said "have been using the column grid-option autoHeight: true", but according to the error "invalid gridOptions property autoHeight" you're adding this property now wrongly to gridOptions instead of the columnDef?


Spot on! Thank you, I was applying the property in the wrong place. Problem solved.

Re: Data Grid with variable row height.

PostPosted: Mon Nov 06, 2023 5:43 pm
by huber
Hi Christian

As you I use the autoHeight option for a data grid, which works nice. But when it's an editable column, and when editing the cell, the text "jumps" to the middle of the field, for which I did not find a CSS solution to avoid this behaviour and keep the text "original", as in image1, while editing.
Do you have the same behaviour?

Tried with selectors like

Code: Select all
.ag-theme-bootstrap .ag-cell.ag-cell-inline-editing .ag-cell-edit-input

without success.

Image1 shows the text in the data grid row, image2 shows the situation when editing the cell.

Re: Data Grid with variable row height.

PostPosted: Mon Nov 06, 2023 8:34 pm
by swingman
Hi, yes I also get a single-line edit field. Annoying.

Re: Data Grid with variable row height.

PostPosted: Wed Nov 08, 2023 4:29 pm
by steve1376656734
Could you use the browser inspector to find the class(es) on that input field when in edit mode and add some CSS to do the text wrapping in your application CSS file?

Re: Data Grid with variable row height.

PostPosted: Fri Jan 26, 2024 4:55 pm
by huber
Hi Steve

Thanks for the hint. I use following style to make it work:

Code: Select all
.wrap-text {
   white-space: -webkit-pre-wrap !important;
   white-space: pre-wrap !important;
   min-height: 36px;
}


Regards,