Skip to content

Textarea Editor

This editor is a custom cell editor for RevoGrid that allows users to handle multi-line text input, making it suitable for applications requiring rich text editing capabilities within grid cells.

To move to the next line within the TextAreaEditor, the user should press Shift + Enter.

Source code
import { defineCustomElements } from '@revolist/revogrid/loader';
import { TextAreaEditor } from '@revolist/revogrid-pro';
defineCustomElements();
export function load(parentSelector: string) {
const grid = document.createElement('revo-grid');
grid.range = true;
grid.rowSize = 60;
grid.source = [
{
name: `John
Doe
`,
},
];
grid.columns = [
{
prop: 'name',
editor: 'textarea',
cellProperties: () => ({ style: { 'white-space': 'pre' } }),
},
];
grid.editors = {
textarea: TextAreaEditor,
};
grid.theme = 'compact';
grid.hideAttribution = true;
document.querySelector(parentSelector)?.appendChild(grid);
}