This commit is contained in:
@@ -14,11 +14,12 @@
|
||||
:search-input.sync="searchEntry"
|
||||
auto-select-first
|
||||
:multiple="multiple"
|
||||
no-filter
|
||||
:filter="customFilter"
|
||||
hide-no-data
|
||||
clearable
|
||||
:no-filter="isTagFilter"
|
||||
>
|
||||
<!-- <template v-slot:no-data>no-filter hide-selected v-on:input="$emit('input', $event)" cache-items="false":no-data-text="lt('NoData')"
|
||||
<!-- <template v-slot:no-data> hide-selected v-on:input="$emit('input', $event)" cache-items="false":no-data-text="lt('NoData')"
|
||||
<v-list-item>
|
||||
<v-list-item-title>
|
||||
Search for your favorite
|
||||
@@ -39,7 +40,7 @@
|
||||
//NOTE: have to import lodash directly here as no combination was working with the window.$gz._
|
||||
//it would not recognize window in the function call
|
||||
import _ from "../libs/lodash.min.js";
|
||||
//todo: drop down get default 100 on non-search
|
||||
|
||||
//todo: custom filter (highlight in results) that works with tags (ignore tag part and filter as normal)
|
||||
//todo: validation error is obscured by no-data element
|
||||
//todo: set actual seleted ID value from our local selected whole object so outer form just gets id
|
||||
@@ -80,7 +81,8 @@ export default {
|
||||
errors: [],
|
||||
selected: { name: "-", id: 0 },
|
||||
searchEntry: null,
|
||||
searchUnderway: false
|
||||
searchUnderway: false,
|
||||
isTagFilter: false
|
||||
//,initialized: false
|
||||
};
|
||||
},
|
||||
@@ -141,6 +143,28 @@ export default {
|
||||
lt: function(ltkey) {
|
||||
return window.$gz.translation.get(ltkey);
|
||||
},
|
||||
customFilter(item, queryText, itemText) {
|
||||
//NOTE: I wanted this to work but all it does is highlight all of each row if tag query is present
|
||||
//I guess because it later on attempts to do the highlighting and can't find all the entered query
|
||||
//it's not clean so I'm just going to make it only highlight if it's a non tag query for now
|
||||
if (queryText.includes(" ") || queryText.startsWith("..")) {
|
||||
this.isTagFilter = true;
|
||||
return false;
|
||||
}
|
||||
return item.name.indexOf(queryText) > -1;
|
||||
//split out just the text search part
|
||||
// var searchText = queryText;
|
||||
// if (queryText.includes(" ")) {
|
||||
// //get the non tag part of query if possible
|
||||
// //ignore bad condition of too many terms
|
||||
// var searchTerms = queryText.split(" ");
|
||||
// if (searchTerms[0].includes("..")) {
|
||||
// searchText = searchTerms[1];
|
||||
// } else {
|
||||
// searchText = searchTerms[0];
|
||||
// }
|
||||
// }
|
||||
},
|
||||
getList: function(urlParams) {
|
||||
var vm = this;
|
||||
// console.log("getlist: calling api.get.picklist for type ", vm.ayaType);
|
||||
|
||||
Reference in New Issue
Block a user