I Have a child table which has a field named score, now I just want to make first row’s score as read-only, without changing any value in that row.
I have tried grid_row.toggle_editable(),but not working for me.
Please suggest me a suitable 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’);
It is working but when I open that row’s grid from side arrow, the read-only things is not working.
and also can you suggest me the event trigger for this, right now I am using on_change of score event on child table but I don’t want to make this happen on change of anything, like whenever I open this doc automatically this child tables field should become read-only.
for row’s grid from side arrow use this code:
form_render:function(frm,cdt,cdn)
{
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’);
}
how to use this code on child table trigger,suggest any trigger please.
i have achieved it on change event of child table but i dont want to do it by on change