Skip to content

Commit ce32315

Browse files
Merge pull request #33 from mlakatkou/GS-3356
[update] readonly article
2 parents 0909d7a + 22fade5 commit ce32315

1 file changed

Lines changed: 20 additions & 19 deletions

File tree

docs/guides/readonly.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,66 +14,67 @@ In this part we want to consider read-only mode in the context of 4 situations:
1414

1515
## Read-only mode for the entire scheduler
1616

17-
To make the entire scheduler read-only, set the [readonly](api/config/readonly.md) option to *true*.
17+
To make the entire scheduler read-only, set the [`readonly`](api/config/readonly.md) option to `true`.
1818

1919
~~~js
2020
scheduler.config.readonly = true;
2121
...
22-
scheduler.init('scheduler_here',new Date(2019, 5,11),"month");
22+
scheduler.init('scheduler_here', new Date(2027, 5, 11), "month");
2323
~~~
24+
2425
Note, when the entire scheduler is non-editable, users can't open the lightbox.
2526

2627

2728
## Read-only mode for the entire lightbox
2829

29-
To leave for users the possibility to open the lightbox, but to forbid any editing inside it, set the [readonly_form](api/config/readonly_form.md) option to *true*:
30+
To leave for users the possibility to open the lightbox, but to forbid any editing inside it, set the [`readonly_form`](api/config/readonly_form.md) option to `true`:
3031

3132

3233
~~~js
3334
scheduler.config.readonly_form = true;
3435
...
35-
scheduler.init('scheduler_here',new Date(2019, 5,11),"month");
36+
scheduler.init('scheduler_here', new Date(2027, 5, 11), "month");
3637
~~~
3738

3839
:::note
39-
The [readonly](api/config/readonly.md) option is provided in the [readonly](guides/extensions-list.md#readonly) extension and to use it, enable the extension on the page.
40+
The [`readonly`](api/config/readonly.md) option is provided in the [readonly](guides/extensions-list.md#readonly) extension, and to use it, enable the extension on the page.
4041
:::
4142

42-
43-
[Read-only lightbox](https://docs.dhtmlx.com/scheduler/samples/03_extensions/12_readonly_form.html)
43+
### Related samples
44+
- [Read-only lightbox](https://docs.dhtmlx.com/scheduler/samples/03_extensions/12_readonly_form.html)
4445

4546

4647
## Read-only mode for a lightbox's section
4748

48-
To make a specific lightbox's section read-only, use the 'disabled' property of a DOM element of the related section object:
49+
To make a specific lightbox's section read-only, use the `disabled` property of a DOM element of the related section object:
4950

5051
~~~js
51-
scheduler.config.lightbox.sections="["
52-
{name:"description", height:200, map_to:"text", type:"textarea" , focus:true},
53-
{name:"time", height:72, type:"time", map_to:"auto"}
52+
scheduler.config.lightbox.sections = [
53+
{ name: "description", height: 200, map_to: "text", type: "textarea", focus: true },
54+
{ name: "time", height: 72, type: "time", map_to: "auto" }
5455
];
5556

56-
scheduler.attachEvent("onLightbox", function(){
57-
var section = scheduler.formSection("description");
58-
section.control.disabled = true;
57+
scheduler.attachEvent("onLightbox", () => {
58+
const descriptionSection = scheduler.formSection("description");
59+
descriptionSection.control.disabled = true;
5960
});
6061
~~~
6162

6263
:::note
63-
Note, you refer to the section through its type and all sections that have this type will be read-only at once
64+
Note, you refer to the section through its type, and all sections that have this type will be read-only at once.
6465
:::
6566

6667
## Read-only mode for specific events
6768

68-
To make specific events read-only, add the property 'read-only' to them and set it to true:
69+
To make specific events read-only, add the `readonly` property to them and set it to `true`:
6970

7071
~~~js
7172
scheduler.getEvent(id).readonly = true;
7273
~~~
7374

7475
:::note
75-
The functionality is provided in the [readonly](guides/extensions-list.md#readonly) extension and to use it, enable the extension on the page.
76+
The functionality is provided in the [readonly](guides/extensions-list.md#readonly) extension, and to use it, enable the extension on the page.
7677
:::
7778

78-
79-
[Read-only events](https://docs.dhtmlx.com/scheduler/samples/03_extensions/14_readonly_event.html)
79+
### Related samples
80+
- [Read-only events](https://docs.dhtmlx.com/scheduler/samples/03_extensions/14_readonly_event.html)

0 commit comments

Comments
 (0)