This commit is contained in:
2020-12-14 22:21:54 +00:00
parent 40e13610b4
commit d4db19a3ff
2 changed files with 55 additions and 9 deletions

View File

@@ -17,7 +17,7 @@
:search-input.sync="searchEntry"
:filter="customFilter"
hide-no-data
:clearable="!readonly"
:clearable="!readonly && canClear"
:no-filter="isTagFilter"
:append-icon="errorIcon"
@click:append="handleErrorClick"
@@ -76,8 +76,12 @@ export default {
showEditIcon: {
type: Boolean,
default: false
},
allowNoSelection: {
type: Boolean,
default: true
},
canClear:{type: Boolean, default: true},
label: { type: String, default: "" }
},
watch: {
@@ -166,9 +170,11 @@ export default {
e = window.$gz.form.getNoSelectionItem(true);
}
this.lastSelection = e;
//this is required for the control to update and parent form to detect it
this.$emit("input", e.id);
this.lastSelection = e;
},
fetchValueIfNotPresent() {
//is there a value that might require fetching?
@@ -274,7 +280,9 @@ export default {
return Promise.reject(res);
}
vm.searchResults = res.data;
if(vm.allowNoSelection){
window.$gz.form.addNoSelectionItem(vm.searchResults, true);
}
vm.replaceLastSelection();
} catch (err) {
window.$gz.errorHandler.handleFormError(err);