Programmatically delete rows of subtable fails on some rows

Seems like this can be resolved/worked around with this code block: How to delete a particular row from a child table? - #8 by sorin.negulescu

var tbl = frm.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();

I like the initial code block better, but it is just not stable enough… :frowning: