I have been using the table component, but this does not appear to support non-continuous selection of records when the foundSet is set to multi-select.
I can select records 2,3,4 but there does not seem to be any way to select just 2 and 4.
The good thing about the table component, however, is that the row height will expand to ensure all the text of a cell fits.
So I decided to try the Data grid. It supports non-continuous selections, but the height of the rows is fixed, except if you construct some HTML with DIV’s set to display as blocks.
Looking in the documentation for ag-grid there are two columns properties called ‘textWrap’ and ‘autoHeight’.
If I try to add these to the columnDef of a Grid Column, servoy complains that these are not in the list of supported properties.
Is there any way around this?
I need a list with variable row height that allows users to select more than one record that are not next to each other…
rph:
Thanks for this answer. The “cellEditor”-Property in your example helped me a lot. I didn’t knew this one.
I’m not sure if it’s the answer to editing long text. The default maxLength is only 200 and since it’s bypassing Servoy’s TextEditor the maxLength of the column format won’t be applied. Setting the AGGrid property columnDefs.cellEditorParams.maxLength also has no effect.
I find it strange that AGGrid’s Text Editor has a default length of 524288, but the Large Text Editor has a default of 200.
Thank you. I re-checked my setup and got it working. If it helps anyone, rather than manually updating all forms I’m running the following method in the onLoad of a generic parent form.
function applyDefaultColumnDefs(_oGrid) {
_oGrid.columns.forEach(
/** @param {CustomType<aggrid-groupingtable.column>} _col */
function(_col) {
if (_col.columnDef && _col.columnDef['cellEditor']) {
// cellEditor = 'agLargeTextCellEditor'
if (_col.columnDef.cellEditor.includes("agLargeTextCellEditor")) {
if (!_col.columnDef['cellEditorParams']) {
_col.columnDef['cellEditorParams'] = {};
}
// Only override if param not set. Could be defined at design-time.
if (!_col.columnDef.cellEditorParams['maxLength']) {
_col.columnDef.cellEditorParams.maxLength = 21845;
}
}
}
}
);
}