Skip to content

Commit aac54e0

Browse files
Merge pull request #68 from platforma-open/khizhnyak/MILAB-1252
MILAB-1252: add row number column
2 parents c9baa85 + 549aa50 commit aac54e0

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.changeset/serious-kings-move.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@platforma-open/milaboratories.mixcr-shm-trees.ui': patch
3+
---
4+
5+
Add row number column

ui/src/pages/MainPage.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
2-
import { type ColDef, type GridOptions } from 'ag-grid-enterprise';
2+
import { type GridReadyEvent, type ColDef, type GridOptions } from 'ag-grid-enterprise';
33
import { AgGridVue } from 'ag-grid-vue3';
4-
import { AgGridTheme, PlAgOverlayLoading, PlAgOverlayNoRows, PlBlockPage, PlBtnGhost, PlMaskIcon24, PlSlideModal } from '@platforma-sdk/ui-vue';
4+
import { AgGridTheme, autoSizeRowNumberColumn, makeRowNumberColDef, PlAgOverlayLoading, PlAgOverlayNoRows, PlBlockPage, PlBtnGhost, PlMaskIcon24, PlSlideModal } from '@platforma-sdk/ui-vue';
55
import { refDebounced } from '@vueuse/core';
66
import { reactive, watch, ref } from 'vue';
77
import { useApp } from '../app';
@@ -32,6 +32,7 @@ const defaultColDef: ColDef = {
3232
}
3333
3434
const columnDefs: ColDef<TreeResult>[] = [
35+
makeRowNumberColDef(),
3536
{
3637
colId: 'donor',
3738
field: 'donor',
@@ -80,6 +81,11 @@ const gridOptions: GridOptions<TreeResult> = {
8081
}
8182
};
8283
84+
const onGridReady = (event: GridReadyEvent) => {
85+
const api = event.api;
86+
autoSizeRowNumberColumn(api);
87+
};
88+
8389
const reloadKey = ref(0);
8490
watch(
8591
() => model.outputs.calculating,
@@ -108,6 +114,7 @@ watch(
108114
:defaultColDef="defaultColDef"
109115
:columnDefs="columnDefs"
110116
:grid-options="gridOptions"
117+
@grid-ready="onGridReady"
111118
:loadingOverlayComponentParams="{ notReady: !model.outputs.calculating, message: `Configure the settings and click
112119
'Run' to see the data` }"
113120
:loadingOverlayComponent=PlAgOverlayLoading

0 commit comments

Comments
 (0)