How to disable a text column inside of a table on Detail Edit page?

I use the following codes to disable the “TextA” column inside TableA and is working with no problem on the Detail Create page but it is not working on the Detail Edit page.
When I debug the record, I can see “TextA” is disabled. Don’t know why it still allows editing.

event.record.TableA.value.forEach(v =>{
    v.value.TextA.disabled = true;
});

Hello annaylee,

Your script to disable fields in a table is correct, so it must be the event handlers.

The following is an example of disabling fields in a table upon creating and editing records.
I also added some scripts in a case when the row in a table is added or deleted.

(function($) {
  'use strict';
kintone.events.on(
  ["app.record.create.show", "app.record.edit.show"],
  (event) => {
    event.record.TableA.value.forEach((r) => {
      r.value.TextA.disabled = true;
    });
    return event;
  }
);

kintone.events.on(
  ["app.record.create.change.TableA", "app.record.edit.change.TableA"],
  (event) => {
    if (event.changes.row) {
      event.changes.row.value.TextA.disabled = true;
    }
    return event;
  }
);
})();