diff --git a/client/core/src/autocomplete/autocomplete.html b/client/core/src/autocomplete/autocomplete.html index 65150f09c..962798629 100644 --- a/client/core/src/autocomplete/autocomplete.html +++ b/client/core/src/autocomplete/autocomplete.html @@ -7,6 +7,7 @@ filter="true" load-more="$ctrl.getItems()" show-load-more="$ctrl.maxRow" + remove-load-more="$ctrl.removeLoadMore" filter-action="$ctrl.findItems(search)" item-width="$ctrl.width" multiple="$ctrl.multiple" diff --git a/client/core/src/autocomplete/autocomplete.js b/client/core/src/autocomplete/autocomplete.js index ae31bff8c..f0e6eb304 100644 --- a/client/core/src/autocomplete/autocomplete.js +++ b/client/core/src/autocomplete/autocomplete.js @@ -23,6 +23,7 @@ class Autocomplete extends Component { this.displayValueMultiCheck = []; this._multiField = []; this.readonly = true; + this.removeLoadMore = false; } get showDropDown() { @@ -229,9 +230,11 @@ class Autocomplete extends Component { let json = JSON.stringify(filter); + this.removeLoadMore = false; + this.$http.get(`${this.url}?filter=${json}`).then( json => { - if (json.data.length) + if (json.data.length) { json.data.forEach( el => { if (this.multiple) { @@ -240,8 +243,12 @@ class Autocomplete extends Component { this.items.push(el); } ); - else + if (filter.skip === 0 && this.maxRow && json.data.length < this.maxRow) { + this.removeLoadMore = true; + } + } else { this.maxRow = false; + } } ); } diff --git a/client/core/src/drop-down/drop-down.html b/client/core/src/drop-down/drop-down.html index 59a7622de..9bab06069 100644 --- a/client/core/src/drop-down/drop-down.html +++ b/client/core/src/drop-down/drop-down.html @@ -17,7 +17,7 @@
{{item.name}}