
[URL] https://ag-grid.com/vue-data-grid/provided-cell-editors-text/
Ag-Grid-Vue 테이블에서 제목 , 설명 컬럼에서 Cell Editing 기능을 사용하였고
Max-Length 를 지정하여야 했다. 방법은 간단하다.
Enabled with agTextCellEditor and configured with ITextCellEditorParams.
columnDefs: [
{
cellEditor: 'agTextCellEditor',
cellEditorParams: {
maxLength: 20
},
},
]
{
headerName: '제목',
headerComponent: GridHeaderRequiredLabel,
field: 'ttl',
editable: true,
minWidth : 180,
cellClass: 'rowCellCustomStyle',
cellEditorParams: { maxLength: 25 },
cellRenderer(params: ICellRendererParams) {
return params.value ? params.value : '25자 이내';
},
sortable: false,
},
cellEditorParams: { maxLength: 25 }, 를 설정하여 maxLength 지정 가능하다.