delete_btn: function(frm, cdt, cdn) {
let row = locals[cdt][cdn];
// get the row index and reduce it by 1 (because JS)
cur_frm.get_field("childtable_field").grid.grid_rows[row.idx-1].remove();
frm.refresh();
}
Adapted from
IMO this is still very complex but okay in comparison. Better would simply need to be row.remove()