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;