replied on March 25, 2018
Hi Tuan,
1. Your script has logic to remove all remaining rows in MyTable2 when delete button on MyTable1 is clicked, because $('.MyTable1 tbody tr').each() would run the function on each row of MyTable1. This does not seem to meet your statement.
2. Another issue is that, after the delete button is clicked, the MyTable1 would be updated; and when your script runs, the original row has been deleted, so you would not get the index of the row before delete. You may try registering the function to on-focus of the delete button but there may be timing issue as well.
3. Even if the logic above is correct, the script would fail because $('.MyTable2 tbody tr:('+(i3).toString()+' .cf-table-delete') is invalid; "tr:(0" has no meaning for JQuery. You should use $('.MyTable2 tbody tr:eq('+(i3).toString()+') .cf-table-delete') instead.