diff --git a/apps/demos/Demos/Scheduler/Timelines/Angular/app/app.component.css b/apps/demos/Demos/Scheduler/Timelines/Angular/app/app.component.css
index 8715394f9a75..fde578e9fbd7 100644
--- a/apps/demos/Demos/Scheduler/Timelines/Angular/app/app.component.css
+++ b/apps/demos/Demos/Scheduler/Timelines/Angular/app/app.component.css
@@ -2,4 +2,17 @@
::ng-deep .dx-scheduler-timeline-week .dx-scheduler-cell-sizes-horizontal,
::ng-deep .dx-scheduler-timeline-work-week .dx-scheduler-cell-sizes-horizontal {
width: 100px;
+}
+
+.options {
+ padding: 20px;
+ background-color: rgba(191, 191, 191, 0.15);
+ margin-top: 20px;
+}
+
+.option {
+ margin-top: 10px;
+ display: flex;
+ align-items: center;
+ gap: 10px;
}
\ No newline at end of file
diff --git a/apps/demos/Demos/Scheduler/Timelines/Angular/app/app.component.html b/apps/demos/Demos/Scheduler/Timelines/Angular/app/app.component.html
index 21c3d025c826..2d3d78d34bd5 100644
--- a/apps/demos/Demos/Scheduler/Timelines/Angular/app/app.component.html
+++ b/apps/demos/Demos/Scheduler/Timelines/Angular/app/app.component.html
@@ -10,6 +10,7 @@
[groups]="['priority']"
[currentDate]="currentDate"
[height]="580"
+ [snapToCellsMode]="snapToCellsMode"
>
+
+
+ Snap to Cells Mode:
+
+
+
diff --git a/apps/demos/Demos/Scheduler/Timelines/Angular/app/app.component.ts b/apps/demos/Demos/Scheduler/Timelines/Angular/app/app.component.ts
index 12687ebc2c96..45732b9c4cc7 100644
--- a/apps/demos/Demos/Scheduler/Timelines/Angular/app/app.component.ts
+++ b/apps/demos/Demos/Scheduler/Timelines/Angular/app/app.component.ts
@@ -1,6 +1,8 @@
import { bootstrapApplication } from '@angular/platform-browser';
import { Component, enableProdMode, provideZoneChangeDetection } from '@angular/core';
-import { DxSchedulerModule } from 'devextreme-angular';
+import { DxSchedulerModule, DxSelectBoxModule } from 'devextreme-angular';
+import type { DxSchedulerTypes } from 'devextreme-angular/ui/scheduler';
+import type { DxSelectBoxTypes } from 'devextreme-angular/ui/select-box';
import {
Priority, Resource, Appointment, Service,
} from './app.service';
@@ -22,6 +24,7 @@ if (window && window.config?.packageConfigPaths) {
providers: [Service],
imports: [
DxSchedulerModule,
+ DxSelectBoxModule,
],
})
export class AppComponent {
@@ -33,11 +36,23 @@ export class AppComponent {
currentDate: Date = new Date(2021, 1, 2);
+ snapToCellsMode: DxSchedulerTypes.SnapToCellsMode = 'always';
+
+ snapToCellsModeItems = [
+ { value: 'auto', text: 'Auto' },
+ { value: 'always', text: 'Always' },
+ { value: 'never', text: 'Never' },
+ ];
+
constructor(service: Service) {
this.appointmentsData = service.getAppointments();
this.resourcesData = service.getResources();
this.prioritiesData = service.getPriorities();
}
+
+ onSnapToCellsModeChanged(e: DxSelectBoxTypes.ValueChangedEvent): void {
+ this.snapToCellsMode = e.value;
+ }
}
bootstrapApplication(AppComponent, {
diff --git a/apps/demos/Demos/Scheduler/Timelines/React/App.tsx b/apps/demos/Demos/Scheduler/Timelines/React/App.tsx
index 3ec30a6ce2d9..1bde415e26e9 100644
--- a/apps/demos/Demos/Scheduler/Timelines/React/App.tsx
+++ b/apps/demos/Demos/Scheduler/Timelines/React/App.tsx
@@ -1,9 +1,11 @@
-import React from 'react';
+import React, { useCallback, useState } from 'react';
import Scheduler, {
Resource,
type SchedulerTypes,
} from 'devextreme-react/scheduler';
+import SelectBox from 'devextreme-react/select-box';
+import type { SelectBoxTypes } from 'devextreme-react/select-box';
import { data, resourcesData, priorityData } from './data.ts';
@@ -11,36 +13,65 @@ const currentDate = new Date(2021, 1, 2);
const views: SchedulerTypes.ViewType[] = ['timelineDay', 'timelineWeek', 'timelineWorkWeek', 'timelineMonth'];
const groups = ['priority'];
-const App = () => (
-
-
-
-
-);
+const snapToCellsModeItems: { value: SchedulerTypes.SnapToCellsMode; text: string }[] = [
+ { value: 'auto', text: 'Auto' },
+ { value: 'always', text: 'Always' },
+ { value: 'never', text: 'Never' },
+];
+
+const App = () => {
+ const [snapToCellsMode, setSnapToCellsMode] = useState('always');
+
+ const onSnapToCellsModeChanged = useCallback((e: SelectBoxTypes.ValueChangedEvent) => {
+ setSnapToCellsMode(e.value);
+ }, []);
+
+ return (
+ <>
+
+
+
+
+
+
+ Snap to Cells Mode:
+
+
+
+ >
+ );
+};
export default App;
diff --git a/apps/demos/Demos/Scheduler/Timelines/React/styles.css b/apps/demos/Demos/Scheduler/Timelines/React/styles.css
index 241ae31e69f5..54ffbf9e6b86 100644
--- a/apps/demos/Demos/Scheduler/Timelines/React/styles.css
+++ b/apps/demos/Demos/Scheduler/Timelines/React/styles.css
@@ -3,3 +3,16 @@
.dx-scheduler-timeline-work-week .dx-scheduler-cell-sizes-horizontal {
width: 100px;
}
+
+.options {
+ padding: 20px;
+ background-color: rgba(191, 191, 191, 0.15);
+ margin-top: 20px;
+}
+
+.option {
+ margin-top: 10px;
+ display: flex;
+ align-items: center;
+ gap: 10px;
+}
diff --git a/apps/demos/Demos/Scheduler/Timelines/ReactJs/App.js b/apps/demos/Demos/Scheduler/Timelines/ReactJs/App.js
index e3d601cfdf95..46a74d70fd3b 100644
--- a/apps/demos/Demos/Scheduler/Timelines/ReactJs/App.js
+++ b/apps/demos/Demos/Scheduler/Timelines/ReactJs/App.js
@@ -1,39 +1,66 @@
-import React from 'react';
+import React, { useCallback, useState } from 'react';
import Scheduler, { Resource } from 'devextreme-react/scheduler';
+import SelectBox from 'devextreme-react/select-box';
import { data, resourcesData, priorityData } from './data.js';
const currentDate = new Date(2021, 1, 2);
const views = ['timelineDay', 'timelineWeek', 'timelineWorkWeek', 'timelineMonth'];
const groups = ['priority'];
-const App = () => (
-
-
-
-
-);
+const snapToCellsModeItems = [
+ { value: 'auto', text: 'Auto' },
+ { value: 'always', text: 'Always' },
+ { value: 'never', text: 'Never' },
+];
+const App = () => {
+ const [snapToCellsMode, setSnapToCellsMode] = useState('always');
+ const onSnapToCellsModeChanged = useCallback((e) => {
+ setSnapToCellsMode(e.value);
+ }, []);
+ return (
+ <>
+
+
+
+
+
+
+ Snap to Cells Mode:
+
+
+
+ >
+ );
+};
export default App;
diff --git a/apps/demos/Demos/Scheduler/Timelines/ReactJs/styles.css b/apps/demos/Demos/Scheduler/Timelines/ReactJs/styles.css
index 241ae31e69f5..54ffbf9e6b86 100644
--- a/apps/demos/Demos/Scheduler/Timelines/ReactJs/styles.css
+++ b/apps/demos/Demos/Scheduler/Timelines/ReactJs/styles.css
@@ -3,3 +3,16 @@
.dx-scheduler-timeline-work-week .dx-scheduler-cell-sizes-horizontal {
width: 100px;
}
+
+.options {
+ padding: 20px;
+ background-color: rgba(191, 191, 191, 0.15);
+ margin-top: 20px;
+}
+
+.option {
+ margin-top: 10px;
+ display: flex;
+ align-items: center;
+ gap: 10px;
+}
diff --git a/apps/demos/Demos/Scheduler/Timelines/Vue/App.vue b/apps/demos/Demos/Scheduler/Timelines/Vue/App.vue
index 934e56c8aac9..1fc10b98274d 100644
--- a/apps/demos/Demos/Scheduler/Timelines/Vue/App.vue
+++ b/apps/demos/Demos/Scheduler/Timelines/Vue/App.vue
@@ -10,6 +10,7 @@
:end-day-hour="20"
:groups="groups"
:first-day-of-week="0"
+ :snap-to-cells-mode="snapToCellsMode"
current-view="timelineMonth"
>
+
+
+ Snap to Cells Mode:
+
+
+
diff --git a/apps/demos/Demos/Scheduler/Timelines/jQuery/index.html b/apps/demos/Demos/Scheduler/Timelines/jQuery/index.html
index 1248636ce82c..a46f8ed427b2 100644
--- a/apps/demos/Demos/Scheduler/Timelines/jQuery/index.html
+++ b/apps/demos/Demos/Scheduler/Timelines/jQuery/index.html
@@ -15,6 +15,12 @@
+
+
+
Snap to Cells Mode:
+
+
+