Check Child Table Checkbox on refresh

Hi,
I wonder if there’s a way to check the little checkbox at the right of a child table using JS (on refresh event). For example, the table ‘items’ in Quotation. If there’s an item.qty > 5 then check the checkbox.
image
I tried to print the row in a foreach, but I don’t see any field that might be linked to what I want.
I really don’t see how to do that :frowning:
Any Idea?

You can iterate the items and when the match your condition you can do this:

// THIS CODE DOES NOT WORK, SEE NEXT COMENT
// var row = frm.fields_dict.LIST_NAME.grid.grid_rows[INDEX];
// row.row_check_html = '<input type="checkbox" class="grid-row-check pull-left" checked>';
// row.refresh_check();

Sorry, my bad, the correct code is:

var row = frm.fields_dict.LIST_NAME.grid.grid_rows[INDEX];
row.select(true);
row.refresh_check();
2 Likes