How to hide/disable delete button for 1st row of child table in frappe?

I have tried some ways writing client script but it didn’t work.

  if (frm.doc.table_hnlr.length > 0) {
            cur_frm.fields_dict['table_hnlr'][0].cannot_delete_rows = 1;
           
        }

Another one

  cur_frm.set_df_property('table_hnlr', 'cannot_delete_rows', 1);
        if (childTable.length > 1) {
            for (var i = 1; i < childTable.length; i++) {
                cur_frm.fields_dict['table_hnlr'][i].cannot_delete_rows = 0;
            }
        }