This repository was archived by the owner on Jul 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathextended-views.tsx
More file actions
56 lines (52 loc) · 2.26 KB
/
extended-views.tsx
File metadata and controls
56 lines (52 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import * as ReactDOM from 'react-dom';
import * as React from 'react';
import {
ScheduleComponent, ViewsDirective, ViewDirective, Day, Week, WorkWeek, Month,
EventRenderedArgs, Inject, Resize, DragAndDrop
} from '@syncfusion/ej2-react-schedule';
import { fifaEventsData, applyCategoryColor } from './datasource';
import { extend } from '@syncfusion/ej2-base';
import { SampleBase } from '../common/sample-base';
/**
* Schedule view based configuration sample
*/
export class ExtendedViews extends SampleBase<{}, {}> {
private scheduleObj: ScheduleComponent;
private data: Object[] = extend([], fifaEventsData, null, true) as Object[];
private onEventRendered(args: EventRenderedArgs): void {
applyCategoryColor(args, this.scheduleObj.currentView);
}
render() {
return (
<div className='schedule-control-section'>
<div className='col-lg-12 control-section'>
<div className='control-wrapper'>
<ScheduleComponent width='100%' height='650px' ref={schedule => this.scheduleObj = schedule}
selectedDate={new Date(2018, 5, 21)} eventSettings={{ dataSource: this.data }}
eventRendered={this.onEventRendered.bind(this)}>
<ViewsDirective>
<ViewDirective option='Day' displayName='3 Days' interval={3} />
<ViewDirective option='Week' displayName='2 Weeks' interval={2} isSelected={true} />
<ViewDirective option='Month' displayName='4 Month' interval={4} />
</ViewsDirective>
<Inject services={[Day, Week, WorkWeek, Month, Resize, DragAndDrop]} />
</ScheduleComponent>
</div>
</div>
<div id='action-description'>
<p>
This demo illustrates how to display n number of days, weeks and months on a single view.
</p>
</div>
<div id='description'>
<p>
In this demo, the
<code>interval</code> property has been defined with different values on each view such as 3 on day view, 2 on week view and
4 on month view – so that 3 days, 2 weeks and 4 months displayed on the respective views. This property is not applicable on
agenda and month agenda views
</p>
</div>
</div>
);
}
}