Hello,
I have the following setup:
afterRemoveRow: function() {
this.invalidCells = []
this.validateCells()
},
afterCreateRow: function(row, amount){
this.invalidCells = []
let rowsCount = this.countRows()
let toValidate = []
for (let i=0; i<rowsCount; i++) {
if (i!= row) {
toValidate.push(i)
if (amount <1) {
row++
amount--
}
}
}
this.validateRows(toValidate)
},
And the steps to reproduce my problem are as following:
- Create empty row above (new row is not validated while created)
- Create empty row below (again, new row is not being validated, but old one does)
- Delete row number 2 (red one)
- Expecting row number 3 to become red, instead number 2 is red.
This approach may look a bit strange, but I need to validate the cells before table is saved to DB. But when I am trying to validate them under the save button handler, validateCells() is too slow and first it saves and then validates (even if I await it). So I decided to make validation after editing and changing table structure (removing or adding rows).