This commit is contained in:
2020-03-19 17:37:15 +00:00
parent 52e9bfef35
commit 80101a477c
2 changed files with 14 additions and 13 deletions

View File

@@ -48,7 +48,8 @@ CURRENT TODOs
@@@@@@@@@@@ ROADMAP STAGE 1 and 2:
todo: consider adding a global setting that allows case *in*sensitive searches or vice versa for picklists
- Case is a pain in the ass on devices
todo: make sure that the picklist control has a delay in it so it doesn't go search on every character typed
- make some sane limits to it
todo: stuff below go-over and make sure nothing missed

View File

@@ -7,7 +7,7 @@
label="lbl Widgets"
v-model="selected"
return-object
:items="sourceresults"
:items="searchResults"
item-text="name"
item-value="id"
item-disabled="!active"
@@ -16,11 +16,12 @@
:placeholder="lt('search hint here')"
:no-data-text="lt('NoData')"
:search-input.sync="searchEntry"
auto-select-first
:multiple="multiple"
cache-items
hide-no-data
no-filter
>
<!-- <template v-slot:no-data>no-filter hide-selected v-on:input="$emit('input', $event)"
<!-- <template v-slot:no-data>no-filter hide-selected v-on:input="$emit('input', $event)" cache-items="false"
<v-list-item>
<v-list-item-title>
Search for your favorite
@@ -57,8 +58,8 @@
{{ searchEntry }}
</div>
<div>
sourceresults
{{ sourceresults }}
searchResults
{{ searchResults }}
</div>
</div>
</template>
@@ -66,15 +67,14 @@
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* eslint-disable */
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//NOTE: I had some concerns about how the selection is made, but leving it for now
//basically the typed text stays after you select from dropdown, however, it clears as soon as you tab off
//and in theory it could help if picking more than one tag that have similar selection criteria
//todo: empty item support
//todo: custom filter that works with tags (ignore tag part and filter as normal)
export default {
created() {
//need to add no selection object if specified
// var vm = this;
// if (vm.noSelectionValid) {
// window.$gz.form.addNoSelectionItem(vm.sourceresults);
// window.$gz.form.addNoSelectionItem(vm.searchResults);
// if (vm.value == null) {
// vm.value = 0;
// }
@@ -84,14 +84,14 @@ export default {
//Set the initial list items based on the record items, this only needs to be called once at init
//Not sure what this is to picklist as it came from tags
// if (!this.initialized && this.value.length > 0) {
// this.sourceresults = this.value;
// this.searchResults = this.value;
// this.initialized = true;
// }
},
data() {
return {
sourceresults: [],
searchResults: [],
errors: [],
selected: { name: "-", id: 0 },
searchEntry: null,
@@ -228,7 +228,7 @@ export default {
//adding this to the property will automatically have it cached by the autocomplete component
//as cache-items has been set so this just needs to be set here once and all is well in future
//Any search will be kept for later so this is very efficient
vm.sourceresults = res.data;
vm.searchResults = res.data;
vm.searchUnderway = false;
})
.catch(err => {