hotFix(smartTable): refresh button await query #1043

Merged
joan merged 1 commits from hotFix_smartTable_awaitRefresh into master 2022-09-07 09:04:28 +00:00
2 changed files with 15 additions and 8 deletions

View File

@ -40,7 +40,8 @@
</vn-button> </vn-button>
</div> </div>
<vn-button icon="refresh" <vn-button icon="refresh"
ng-click="$ctrl.model.refresh()" ng-click="$ctrl.refresh()"
disabled="$ctrl.isRefreshing"
vn-tooltip="Refresh"> vn-tooltip="Refresh">
</vn-button> </vn-button>
</div> </div>

View File

@ -511,6 +511,12 @@ export default class SmartTable extends Component {
return this.model.save() return this.model.save()
.then(() => this.vnApp.showSuccess(this.$t('Data saved!'))); .then(() => this.vnApp.showSuccess(this.$t('Data saved!')));
} }
refresh() {
this.isRefreshing = true;
this.model.refresh()
.then(() => this.isRefreshing = false);
}
} }
SmartTable.$inject = ['$element', '$scope', '$transclude']; SmartTable.$inject = ['$element', '$scope', '$transclude'];