Skip to content

Commit c3daaf4

Browse files
Merge pull request #38 from DHTMLX/views-next-v2.3.0
Dedicated page for view configuration
2 parents 3c5e4bd + eb84f25 commit c3daaf4

File tree

6 files changed

+573
-20
lines changed

6 files changed

+573
-20
lines changed

docs/api/config/js_eventcalendar_config_config.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ config?: {
2525
eventsOverlay?: boolean,
2626
autoSave?: boolean,
2727
readonly?: boolean,
28+
highlightReadonly?: boolean,
2829
dimPastEvents?: boolean,
2930
dateClick?: boolean | string, // (true/false or "day" | "week" | "month" | "year" | "agenda" | "timeline")
3031
dateTitle?: (date, [start, end]) => string,
@@ -82,7 +83,7 @@ config?: {
8283
step?: array, // [number, "day" | "week" | "month" | "year" | "hour" | "minute"]
8384
header?: [
8485
{
85-
unit: string, // "year" | "month" | "quarter" | "month" | "week" | "day" | "hour" | "minute"
86+
unit: string, // "year" | "month" | "quarter" | "week" | "day" | "hour" | "minute"
8687
format: string, // date-fns format
8788
step: number
8889
},
@@ -95,8 +96,8 @@ config?: {
9596
// ... other custom parameters
9697
},
9798
// other sections config
98-
],
99-
},
99+
]
100+
}
100101
},
101102
// other views config
102103
]
@@ -116,6 +117,7 @@ In the **config** object you can specify the following parameters:
116117
- `eventsOverlay` - (optional) enables/disables an ability to overlay events
117118
- `autoSave` - (optional) enables/disables an ability to auto save event data (via the editor)
118119
- `readonly` - (optional) enables/disables an ability to perform operations on events
120+
- `highlightReadonly` - (optional) enables/disables highlighting the readonly events
119121
- `dimPastEvents` - (optional) enables/disables an ability to dim past events
120122
- `dateClick` - (optional) defines a behavior of clicking on the date in a grid cell in the following way:
121123
- ***true/false*** - enables/disables an ability to click on the date in a grid cell to go to the corresponding day
@@ -167,7 +169,7 @@ calendarValidation: calendar => {
167169
- `views` - (optional) an array of configuration objects of the specific (custom) view modes. For each view mode you can specify the following settings:
168170
- `id` - (required) an ID of the view mode
169171
- `label` - (required) a label of the view mode
170-
- `layout` - (required) a predefined layout of the view mode. Here you can specify the following values: *"year" | "month" | "quarter" | "month" | "week" | "day" | "hour" | "minute"*
172+
- `layout` - (required) a predefined layout of the view mode. Here you can specify the following values: *"year" | "month" | "week" | "day" | "agenda" | "timeline"*
171173
- `config` - (optional) an object of the custom view mode settings
172174

173175
:::note
@@ -258,7 +260,7 @@ step: [8, "hour"], // "day" | "week" | "month" | "year" | "hour" | "minute"
258260
~~~
259261

260262
- `header?: array` - defines headers for the Timeline grid. In this array you can specify objects with the following parameters:
261-
- `unit: string` - a timeline unit. Here you can specify one of the following values: *"year" | "month" | "quarter" | "month" | "week" | "day" | "hour" | "minute"*
263+
- `unit: string` - a timeline unit. Here you can specify one of the following values: *"year" | "month" | "quarter" | "week" | "day" | "hour" | "minute"*
262264
- `format: string` - a time format (use a [date-fns](https://date-fns.org/) format)
263265
- `step: number` - a time duration
264266

@@ -298,12 +300,11 @@ sections: [
298300
~~~jsx {}
299301
const defaultWeekConfig = {
300302
eventHorizontalSpace: 3,
301-
columnPadding: "8px",
302-
303+
columnPadding: "8px"
303304
};
304305

305306
const defaultMonthConfig = {
306-
maxEventsPerCell: 4,
307+
maxEventsPerCell: 4
307308
};
308309

309310
const defaultTimelineConfig = {
@@ -329,7 +330,7 @@ const defaultTimelineConfig = {
329330
{ id: "8", label: "Section 8" },
330331
{ id: "9", label: "Section 9" },
331332
],
332-
unassignedCol: false,
333+
unassignedCol: false
333334
};
334335

335336
const defaultConfig = {
@@ -344,6 +345,7 @@ const defaultConfig = {
344345
eventsOverlay: false,
345346
autoSave: true,
346347
readonly: false,
348+
highlightReadonly: true,
347349

348350
tableHeaderHeight: 32,
349351
eventHeight: 24,
@@ -376,7 +378,7 @@ const defaultConfig = {
376378
},
377379
{ id: "year", label: "Year", layout: "year" },
378380
{ id: "agenda", label: "Agenda", layout: "agenda" },
379-
],
381+
]
380382
};
381383
~~~
382384

@@ -387,13 +389,14 @@ To set the **config** property dynamically, you can use the
387389

388390
### Example
389391

390-
~~~jsx {3-50}
392+
~~~jsx {3-51}
391393
// create Event Calendar
392394
new eventCalendar.EventCalendar("#root", {
393395
config: {
394396
autoSave: false,
395397
dragResize: false,
396398
readonly: true,
399+
highlightReadonly: false,
397400
dragMove: false,
398401
viewControl: "toggle",
399402
dimPastEvents: true,
@@ -436,7 +439,7 @@ new eventCalendar.EventCalendar("#root", {
436439
},
437440
},
438441
// other custom views config
439-
],
442+
]
440443
},
441444
// other configuration parameters
442445
});
@@ -449,3 +452,4 @@ new eventCalendar.EventCalendar("#root", {
449452
- The ***dateTitle***, ***eventVerticalSpace*** and ***eventHorizontalSpace*** properties were added in v2.1
450453
- The ***eventMargin*** property was deprecated in v2.1
451454
- The ***calendarValidation*** and ***defaultEditorValues*** properties were added in v2.2
455+
- The ***highlightReadonly*** property was added in v2.3

docs/api/config/js_eventcalendar_templates_config.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ To set the templates dynamically, you can use the
6363

6464
### Example
6565

66-
~~~jsx {5-14,16-22,24-30,32-44,46-55,57-63,65-73,75-88,90-97}
66+
~~~jsx {6-15,17-23,25-31,33-45,47-56,58-64,66-74,76-89,91-97}
67+
const { dateFns, EventCalendar } = eventCalendar;
6768
const { format } = dateFns; // date-fns library (https://date-fns.org/)
68-
new eventCalendar.EventCalendar("#root", { // create Event Calendar
69+
new EventCalendar("#root", { // create Event Calendar
6970
templates: {
7071
// the event template of the "Week" and "Day" modes
7172
weekEvent: ({ event, calendar }) => {

docs/guides/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
sidebar_label: Configuration
3-
title: Configuration
2+
sidebar_label: Common Configuration
3+
title: Common Configuration
44
description: You can learn about the configuration in the documentation of the DHTMLX JavaScript Event Calendar library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Event Calendar.
55
---
66

7-
# Configuration
7+
# Common Configuration
88

99
You can configure the *Event Calendar* appearance and functionality via corresponding API. The available parameters will allow you to:
1010

0 commit comments

Comments
 (0)