Delete child row with more than 50 items, Pagination

cur_frm.get_field(“child_table”).grid.grid_rows[i].remove();
works well with child tables that have less than 50 rows.

If the items are greater than 50 a pagination is created . In this case I get errors.

I tried to use th $.each with cur_frm.get_field("child_table").grid.grid_rows[i].remove();
but it also raised too many errors.
Any help please :slight_smile: