From afec14a17ebf17722f3f9548b44e07b411b1f8a7 Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 7 Aug 2020 14:12:30 -0600 Subject: [PATCH] Fix removing a nm row did not re-index This caused duplications or holes depending on what you did before or after --- api/js/etemplate/et2_extension_nextmatch.js | 2 +- api/js/etemplate/et2_extension_nextmatch.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/et2_extension_nextmatch.js b/api/js/etemplate/et2_extension_nextmatch.js index d981b0fc48..36dbcfef9d 100644 --- a/api/js/etemplate/et2_extension_nextmatch.js +++ b/api/js/etemplate/et2_extension_nextmatch.js @@ -576,7 +576,7 @@ var et2_nextmatch = /** @class */ (function (_super) { var entry = this.controller._selectionMgr._getRegisteredRowsEntry(uid); // Need to delete first as there's a good chance indexes will change in an unknown way // and we can't always find it by UID after due to duplication - this.controller._grid.deleteRow(entry.idx); + this.controller.deleteRow(uid); // Pretend it's a new row, let app tell us where it goes and we'll mark it as new if (!this.refresh_add(uid, et2_nextmatch.UPDATE)) { // App did not want the row, or doesn't know where it goes but we've already removed it... diff --git a/api/js/etemplate/et2_extension_nextmatch.ts b/api/js/etemplate/et2_extension_nextmatch.ts index 8f6bf037bc..6641c03a18 100644 --- a/api/js/etemplate/et2_extension_nextmatch.ts +++ b/api/js/etemplate/et2_extension_nextmatch.ts @@ -870,7 +870,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2 // Need to delete first as there's a good chance indexes will change in an unknown way // and we can't always find it by UID after due to duplication - this.controller._grid.deleteRow(entry.idx); + this.controller.deleteRow(uid); // Pretend it's a new row, let app tell us where it goes and we'll mark it as new if(!this.refresh_add(uid, et2_nextmatch.UPDATE))