Hello,
I’m having validation issue when I remove a row with a table containing a spare row.
On the following fiddle just remove the first row and see the issue:
https://jsfiddle.net/gnz24e51/
Thank you.
Regards.
Hello,
I’m having validation issue when I remove a row with a table containing a spare row.
On the following fiddle just remove the first row and see the issue:
https://jsfiddle.net/gnz24e51/
Thank you.
Regards.
If you want to skip the validation for an empty row I recommend adding a condition to the validator
if(value === null){
callback(true);
}
Updated demo: https://jsfiddle.net/2aznfm17/
Hi @aleksandra_budnik,
Your “trick” actually “fixed” the issue in this special case, but it’s not viable in a real project as you can’t differentiate an empty mail in a real row and an empty mail from the spare row. It means an empty mail is considered as valid and that’s probably not something expected.
If you look at console logs in my fiddle you’ll see that after row is removed, the 2 remaining rows are both 0 indexed and that’s an issue.
Please take a look at this fiddle where the only difference is the timeout added in the “afterRemoveRow” hook:
https://jsfiddle.net/xzLuhbcq/
This time the rows have correct indexes and the validation issue not present.
From my point point of view the “afterRemoveRow” is triggered too early, before model was updated maybe.
Thanks.
The timeout itself is a good idea as the validation process is asynchronous. The timeout changes the order of tasks.