diff --git a/ayanova/src/components/pick-list.vue b/ayanova/src/components/pick-list.vue index af62bc84..b0f6cf8a 100644 --- a/ayanova/src/components/pick-list.vue +++ b/ayanova/src/components/pick-list.vue @@ -67,8 +67,10 @@ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// /* eslint-disable */ //////////////////////////////////////////////////////////////////////////////////////////////////////////// +import _ from "../libs/lodash.min.js"; //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 @@ -135,11 +137,13 @@ export default { return; } } + console.log("Calling test from watcher"); + // this.test(); + + this.doSearch(); //doSearch(vm, val); //window.$gz._.debounce(doSearch(vm, val), 1300); //debounce and don't search constantly on every keystroke - console.log("Calling debounced test..."); - this.test(); }, value(val) { //this ensures the parent form gets the onchange event @@ -154,7 +158,20 @@ export default { lt: function(ltkey) { return window.$gz.translation.get(ltkey); }, - doSearch: window.$gz._.debounce(function() { + test: _.debounce(function() { + console.log("log from inside debounce"); + }, 500), + // test: function() { + // console.log("In test calling debounce..."); + // window.$gz._.debounce(function() { + // console.log("log from inside debounce"); + // }, 500); + // }, + doSearch: _.debounce(function() { + var vm=this; + console.log("Inside Debounced function"); + //NOTE debounce with a watcher is a bit different + //https://vuejs.org/v2/guide/migration.html#debounce-Param-Attribute-for-v-model-removed //----------------- //Pre-process the query to validate and send conditionally var val = this.searchEntry; @@ -254,7 +271,7 @@ export default { }); //------------ - }, 1300) + }, 500) }, beforeCreate() { //check pre-requisites exist just in case