How to Toggle Readonly on Child Table Specific Row

I want to make field standard_rate in child table readonly based on another child table field.
I try this code :
frappe.meta.get_docfield(“Resource Item”, ‘standard_rate’, = 0;
but it make readonly for all row in child table.
i want to make just specific row readonly…any help?

1 Like

I find the solution :
var grid_row = locals[cdt][cdn];
$(“div[data-idx='”+grid_row.idx+“']”).find(“input[data-fieldname=‘here field name of child table’]”).css(‘pointer-events’,‘none’);

Hello @Shaqire

I have a use case slightly similar to yours. I would like to have the entire row of a child table to be read only when a field on that child table changes to paid.

Doctype : Plan
Link field to child table : milestone
Child table name: Milestone Table
Trigger Field on the child table : status

Erpnext Version 12

@Chibuzor_Derrick Assuming that the status field is of type Select, then you can create a Client Script, apply it to the form of Plan doctype and use the following code.

The code is not tested so I hope that it works for you.

frappe.ui.form.on('Milestone Table', {
    status: function(frm, cdt, cdn) {
        var row = frm.get_field('milestone').grid.get_row(cdn),
        read_only = cdt.status === 'Paid';
        row.columns_list.forEach(function(column) {
            if (column.df.fieldname !== 'status') {
                row.toggle_editable(column.df.fieldname, read_only);

If the status is Paid then every other field will be read only except for the status field, but if the status is not Paid then the other fields will be editable.

I have a similar problem. Could you please take a look at my topic?