I have a table that populates in the member section and is filtered to the owner. What I am trying to achieve is to have the owner select a row in the table and have it remove from the dataset, then refresh. I am trying to accomplish this from onCellSelect so that I can control how the rows get removed. If cell value equals 'Leave class', then it removes row containing the selected cell.
I believe I'm close, but am not sure. Code below removes row, but only the first (current?) row and not that of the selected cell. The popup notice also flashes in and out quickly, but unsure how or where to place in the code to have it perform correctly:
In case anyone stumbles across this thread and looking for the solution:
I was able to get the correct row removed using on cell select if that cell value equaled 'Leave class'. I created const index that equaled the cell's row index, then another const id that included that index value with the target rows id. Then just set the remove to that const id.
Here's the snippet of updated code:
let fitClass = event.cellData; const index = event.cellRowIndex; const idToDelete = event.target.rows[index]._id; if (fitClass === 'Leave class'){ wixData.remove('FitnessSignup', idToDelete)