File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-blocks/DatabaseBlock Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import {
11
11
12
12
import { AddButtonComponent } from './AddColumnButton' ;
13
13
import { useColumns , useRows } from './hooks' ;
14
- import { addRowCellRenderer , createNewRow } from './utils' ;
14
+ import { addRowCellRenderer , autoSizeStrategy , createNewRow } from './utils' ;
15
15
16
16
export const DatabaseGrid = ( {
17
17
documentId,
@@ -102,6 +102,8 @@ export const DatabaseGrid = ({
102
102
filter : true ,
103
103
editable : true ,
104
104
unSortIcon : true ,
105
+ suppressSizeToFit : true ,
106
+ minWidth : 200 ,
105
107
} ;
106
108
107
109
const addColumn = ( columnName : string ) => {
@@ -139,6 +141,7 @@ export const DatabaseGrid = ({
139
141
defaultColDef = { defaultColDef }
140
142
domLayout = "autoHeight"
141
143
enableCellSpan = { true }
144
+ autoSizeStrategy = { autoSizeStrategy }
142
145
/>
143
146
</ Box >
144
147
) ;
Original file line number Diff line number Diff line change 1
- import { ICellRendererParams } from 'ag-grid-community' ;
1
+ import {
2
+ ICellRendererParams ,
3
+ SizeColumnsToContentStrategy ,
4
+ } from 'ag-grid-community' ;
2
5
import { Dispatch , SetStateAction } from 'react' ;
3
6
4
7
import { AddRowButton } from './AddRowButton' ;
5
8
9
+ export const autoSizeStrategy : SizeColumnsToContentStrategy = {
10
+ type : 'fitCellContents' ,
11
+ } ;
12
+
6
13
export const createNewRow = (
7
14
value : string | undefined ,
8
15
columnNames : string [ ] | undefined ,
You can’t perform that action at this time.
0 commit comments