ReadOnly property

I cant seem to find a ReadOnly property on TXDataWebDataSet or TWebDataSource.

  • Is there a built in routine to make linked data controls Readonly?
  • If not, is there a list of controls linked to either of them?

I tried TXDataWebDataSet.DisableControls

  • The appearance did not change (which doesn't matter)
  • Input elements appeared to be read-only.
  • But Selects were still read-write

So I am using this (for other users)

class procedure THtml.Disable_Controls (const AId : string);
begin
  asm
    const container = document.getElementById(AId);
    const formControls = container.querySelectorAll('input, select, textarea');
    formControls.forEach(control => {control.disabled = true;});
  end;
end;

It takes the Id of the container div. And works like magic. I didn't want the buttons to be disabled, if you do, add button to the list.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.