From 1f1b4d1bec00bcac054812cb3d18855d9b778673 Mon Sep 17 00:00:00 2001 From: marthasharkey Date: Wed, 10 Jul 2024 22:25:59 +0100 Subject: [PATCH] reintroduce column sort (#10496) This re introduces the column sort behaviour that was lost when the type indicator was added ![column-sort](https://github.com/enso-org/enso/assets/170310417/fe33faed-d816-4447-bd57-755fd3c06856) --- .../visualizations/TableVisualization.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/gui2/src/components/visualizations/TableVisualization.vue b/app/gui2/src/components/visualizations/TableVisualization.vue index 22e2f9e4e8..fda33fed43 100644 --- a/app/gui2/src/components/visualizations/TableVisualization.vue +++ b/app/gui2/src/components/visualizations/TableVisualization.vue @@ -136,7 +136,7 @@ useAutoBlur(tableNode) const widths = reactive(new Map()) const defaultColDef = { editable: false, - sortable: true as boolean, + sortable: true, filter: true, resizable: true, minWidth: 25, @@ -327,14 +327,24 @@ function toField(name: string, valueType?: ValueType | null | undefined): ColDef icon = 'mixed' } const svgTemplate = ` ` + const menu = ` ` + const sort = ` + + + + + + ` const template = icon ? - `
${name} ${svgTemplate}
` - : `
${name}
` + ` ${name} ${menu} ${sort} ${svgTemplate}` + : `${name} ${menu} ${sort}` return { field: name, headerComponentParams: { template, + enableSorting: true, + setAriaSort: () => {}, }, headerTooltip: displayValue ? displayValue : '', } @@ -541,7 +551,6 @@ watchEffect(() => { // If data is truncated, we cannot rely on sorting/filtering so will disable. options.defaultColDef.filter = !isTruncated.value - options.defaultColDef.sortable = !isTruncated.value options.api.setColumnDefs(mergedColumnDefs) options.api.setRowData(rowData) })