Improve logic for Add Filter grid button/autocomplete
this should work for oruga as well as buefy
This commit is contained in:
parent
e030dc841d
commit
6bee65780c
|
@ -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:
|
||||||
|
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue