Skip to content

Commit 037024f

Browse files
committed
can group by nook or type
1 parent 753962e commit 037024f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/src/pages/sync.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ import {
3535
} from 'ag-grid-community2'
3636
import 'ag-grid-community2/styles/ag-grid.css'
3737
import 'ag-grid-community2/styles/ag-theme-alpine.css'
38+
import { LicenseManager } from 'ag-grid-enterprise2'
3839
import { DiffModeToggleGroup } from '../components/diffModeContext'
3940

41+
LicenseManager.setLicenseKey(import.meta.env.VITE_AG_GRID_LICENSE)
42+
4043
async function postMedia(
4144
type: 'note' | 'template',
4245
mediaId: MediaId,
@@ -156,7 +159,6 @@ class CellRenderer implements ICellRendererComp<Row> {
156159

157160
init(params: ICellRendererParams<Row, unknown, Context>) {
158161
if (params.data == null) {
159-
this.eGui.textContent = 'N/A'
160162
return
161163
}
162164
const remoteTemplate = params.data.template.remotes[params.data.nook]
@@ -235,8 +237,8 @@ function Content(): JSX.Element {
235237
onMount(() => {
236238
const gridOptions = {
237239
columnDefs: [
238-
{ field: 'nook' },
239-
{ field: 'type' },
240+
{ field: 'nook', enableRowGroup: true },
241+
{ field: 'type', enableRowGroup: true },
240242
{
241243
headerName: 'Diff',
242244
headerComponent: HeaderRenderer,
@@ -254,6 +256,7 @@ function Content(): JSX.Element {
254256
},
255257
suppressRowHoverHighlight: true,
256258
enableCellTextSelection: true,
259+
rowGroupPanelShow: 'onlyWhenGrouping',
257260
} satisfies GridOptions<Row> as GridOptions<Row>
258261
gridApi = createGrid(ref, gridOptions)
259262
})

0 commit comments

Comments
 (0)