This commit is contained in:
@@ -57,30 +57,38 @@ todo: option to display icon to open the record selected, (we have the type and
|
|||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
created() {
|
created() {
|
||||||
//need to add no selection object if specified
|
|
||||||
var vm = this;
|
var vm = this;
|
||||||
//console.log("CREATED: calling getList for type ", this.ayaType);
|
console.log("CREATED:value is ", this.value);
|
||||||
if (vm.preFill) {
|
|
||||||
|
//need to add no selection object if specified
|
||||||
|
if (vm.noSelectionValid) {
|
||||||
|
window.$gz.form.addNoSelectionItem(vm.searchResults);
|
||||||
|
// debugger;
|
||||||
|
//TODO: this may be needed to force new records to have a zero in their no selection valid fields rather than null
|
||||||
|
// however it could overwrite a valid value maybe so needs further testing
|
||||||
|
//this.$emit("input", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//set initial value in control if selected
|
||||||
|
if (vm.value != null && vm.value != 0) {
|
||||||
|
//It has a prior non empty selection that needs to be fetched
|
||||||
|
//note that by default this will just fetch the selected record instead of the prefill list
|
||||||
|
console.log("STUB: created: has value, sb fetched");
|
||||||
|
} else if (vm.preFill) {
|
||||||
|
//no non-empty initial value to select but list specified to pre-fill
|
||||||
vm.searchUnderway = true;
|
vm.searchUnderway = true;
|
||||||
vm.getList();
|
vm.getList();
|
||||||
} else {
|
}
|
||||||
if (vm.noSelectionValid) {
|
|
||||||
window.$gz.form.addNoSelectionItem(vm.searchResults);
|
|
||||||
// debugger;
|
|
||||||
|
|
||||||
//TODO: this may be needed to force new records to have a zero in their no selection valid fields rather than null
|
|
||||||
// however it could overwrite a valid value maybe so needs further testing
|
|
||||||
//this.$emit("input", 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
beforeUpdate() {
|
beforeUpdate() {
|
||||||
//Set the initial list items based on the record items, this only needs to be called once at init
|
//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
|
//Not sure what this is to picklist as it came from tags
|
||||||
// if (!this.initialized && this.value.length > 0) {
|
//console.log("beforeupdate: value is ", this.value);
|
||||||
// this.searchResults = this.value;
|
if (!this.initialized && this.value && this.value != 0) {
|
||||||
// this.initialized = true;
|
//fetch here
|
||||||
// }
|
|
||||||
|
this.initialized = true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
@@ -91,8 +99,8 @@ export default {
|
|||||||
searchEntry: null,
|
searchEntry: null,
|
||||||
searchUnderway: false,
|
searchUnderway: false,
|
||||||
isTagFilter: false,
|
isTagFilter: false,
|
||||||
errorIcon: null
|
errorIcon: null,
|
||||||
//,initialized: false
|
initialized: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@@ -128,7 +136,7 @@ export default {
|
|||||||
//clear any local errors
|
//clear any local errors
|
||||||
vm.errors = [];
|
vm.errors = [];
|
||||||
// console.log("WATCH::SEARCHENTRY TRIGGERED:", val);
|
// console.log("WATCH::SEARCHENTRY TRIGGERED:", val);
|
||||||
if (!val || vm.searchUnderway) {
|
if (!val || vm.searchUnderway || !vm.initialized) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (vm.selected != null) {
|
if (vm.selected != null) {
|
||||||
@@ -136,7 +144,7 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//console.log("WATCH::SEARCHENTRY doing search now");
|
// console.log("WATCH::SEARCHENTRY doing search now");
|
||||||
this.doSearch();
|
this.doSearch();
|
||||||
},
|
},
|
||||||
// value(val) {
|
// value(val) {
|
||||||
|
|||||||
Reference in New Issue
Block a user