diff --git a/ayanova/src/components/work-order-item-scheduled-users.vue b/ayanova/src/components/work-order-item-scheduled-users.vue index f08bf5a8..bdf4cc5c 100644 --- a/ayanova/src/components/work-order-item-scheduled-users.vue +++ b/ayanova/src/components/work-order-item-scheduled-users.vue @@ -91,10 +91,7 @@ export default { created() { - if (this.value.items[this.activeWoItemIndex].scheduledUsers.length == 1) { - this.selectedRow = [{ index: 0 }]; - this.activeItemIndex = 0; - } + this.setDefaultView(); }, data() { return { @@ -156,7 +153,9 @@ export default { this.activeItemIndex, 1 ); - + this.setDefaultView(); + }, + setDefaultView: function() { //if only one record left then display it otherwise just let the datatable show what the user can click on if (this.value.items[this.activeWoItemIndex].scheduledUsers.length == 1) { this.selectedRow = [{ index: 0 }]; diff --git a/ayanova/src/components/work-order-items.vue b/ayanova/src/components/work-order-items.vue index 47f3e1df..5f0fbe1d 100644 --- a/ayanova/src/components/work-order-items.vue +++ b/ayanova/src/components/work-order-items.vue @@ -102,10 +102,7 @@ export default { GzWoItemScheduledUsers }, created() { - if (this.value.items.length == 1) { - this.selectedRow = [{ index: 0 }]; - this.activeItemIndex = 0; - } + this.setDefaultView(); }, data() { return { @@ -169,6 +166,9 @@ export default { }); } this.value.items.splice(this.activeItemIndex, 1); + this.setDefaultView(); + }, + setDefaultView: function() { //if only one record left then display it otherwise just let the datatable show what the user can click on if (this.value.items.length == 1) { this.selectedRow = [{ index: 0 }];