domain: client
language: javascript
class Item class
Read the read_only
property to determines whether the data can be modified in
data-aware controls.
Set read_only
property to true
to prevent data from being modified in
data-aware controls.
When you assign a value to the read_only property, the application sets the read_only property of all the details and the read_only property of each field to that value.
If the user role prohibits editing of the record, read_only
always returns true
.
In this example we first set read_only
attribute of the invoices item
to true
. It makes all fields and invoice_table detail read only. After that
we allow a user to edit customer field and invoice_table detail.
function on_edit_form_created(item) {
item.read_only = true;
item.customer.read_only = false;
item.invoice_table.read_only = false;
}