From e33026cad74f0e379754ca835a6a54495885d4a0 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 9 Apr 2021 18:43:06 +0000 Subject: [PATCH] --- ayanova/src/components/work-order-items.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ayanova/src/components/work-order-items.vue b/ayanova/src/components/work-order-items.vue index 4cf996e1..99826b9f 100644 --- a/ayanova/src/components/work-order-items.vue +++ b/ayanova/src/components/work-order-items.vue @@ -173,15 +173,20 @@ export default { let o = this.value.items[this.activeItemIndex]; if (o.id != 0) { //it's a previously saved item so it needs to be removed at the server too - //todo: event delete graphitem - this.deletedItems.push(o.id); this.$emit("graph-item-deleted", { atype: window.$gz.type.WorkOrderItem, id: o.id }); } this.value.items.splice(this.activeItemIndex, 1); - this.selectedRow = []; - this.activeItemIndex = null; //select nothing in essence resetting a child selects and this one too clearing form + //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 }]; + this.activeItemIndex = 0; + } else { + this.selectedRow = []; + this.activeItemIndex = null; //select nothing in essence resetting a child selects and this one too clearing form + } }, handleRowClick: function(item) { this.activeItemIndex = item.index;