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

View file

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