[vue-study] Ag-Grid-Vue : Cell Editing Max-Length 설정

JooSehyun·2024년 4월 29일
0

[Study]

목록 보기
33/35
post-thumbnail

[vue-study] Ag-Grid-Vue : Cell Editing Max-Length 설정


[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 지정 가능하다.


0개의 댓글