Improve logic for Add Filter grid button/autocomplete

this should work for oruga as well as buefy
This commit is contained in:
Lance Edgar 2024-04-25 22:00:01 -05:00
parent e030dc841d
commit 6bee65780c
2 changed files with 9 additions and 1 deletions

View file

@ -294,6 +294,7 @@
computed: {
addFilterChoices() {
// nb. this returns all choices available for "Add Filter" operation
// collect all filters, which are *not* already shown
let choices = []
@ -354,6 +355,13 @@
methods: {
formatAddFilterItem(filtr) {
if (!filtr.key) {
filtr = this.filters[filtr]
}
return filtr.label || filtr.key
},
% if grid.click_handlers:
cellClick(row, column, rowIndex, columnIndex) {
% for key in grid.click_handlers:

View file

@ -32,7 +32,7 @@
v-model="addFilterTerm"
placeholder="Add Filter"
field="key"
:custom-formatter="filtr => filtr.label"
:custom-formatter="formatAddFilterItem"
open-on-focus
keep-first
icon-pack="fas"