Here is my shot at it. I strongly believe that the solution is to parse the array from the last to the first element. In this way, the array elements that get re-indexed will not affect the behavior:
var tbl = doc.child_table || [];
var i = tbl.length;
while (i--)
{
if(tbl[i].field_name == '')
{
cur_frm.get_field("child_table").grid.grid_rows[i].remove();
}
}
cur_frm.refresh();
Give it a try ![]()