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 pathgroup-by-date.tsx
More file actions
71 lines (67 loc) · 2.69 KB
/
group-by-date.tsx
File metadata and controls
71 lines (67 loc) · 2.69 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import * as ReactDOM from 'react-dom';
import * as React from 'react';
import {
Day, Week, Month, Agenda, ScheduleComponent, ViewsDirective,
ViewDirective, ResourcesDirective, ResourceDirective, Inject, Resize, DragAndDrop
} from '@syncfusion/ej2-react-schedule';
import { resourceData } from './datasource';
import { extend } from '@syncfusion/ej2-base';
import { SampleBase } from '../common/sample-base';
/**
* schedule resources group-bydate sample
*/
export class GroupByDate extends SampleBase<{}, {}> {
private data: Object[] = extend([], resourceData, null, true) as Object[];
private resourceData: Object[] = [
{ text: 'Alice', id: 1, color: '#1aaa55' },
{ text: 'Smith', id: 2, color: '#7fa900' },
];
render() {
return (
<div className='schedule-control-section'>
<div className='col-lg-12 control-section'>
<div className='control-wrapper'>
<ScheduleComponent width='100%' height='650px' selectedDate={new Date(2018, 3, 1)}
eventSettings={{
dataSource: this.data, fields: {
subject: { title: 'Task', name: 'Subject' },
location: { title: 'Project Name', name: 'Location' },
description: { title: 'Comments', name: 'Description' }
}
}}
group={{ byDate: true, resources: ['Owners'] }} >
<ResourcesDirective>
<ResourceDirective field='TaskId' title='Assignee' name='Owners' allowMultiple={true}
dataSource={this.resourceData} textField='text' idField='id' colorField='color'>
</ResourceDirective>
</ResourcesDirective>
<ViewsDirective>
<ViewDirective option='Day' />
<ViewDirective option='Week' />
<ViewDirective option='Month' />
<ViewDirective option='Agenda' />
</ViewsDirective>
<Inject services={[Day, Week, Month, Agenda, Resize, DragAndDrop]} />
</ScheduleComponent>
</div>
</div>
<div id="action-description">
<p>
This demo illustrates the daily tasks of two employees grouped by date-wise.
</p>
</div>
<div id="description">
<p>
In this demo, there are 2 resources defined namely
<strong>Alice</strong> and
<strong>Smith</strong> under the resource
<code>dataSource</code>. The Schedule can be switched to group by date, by setting
<code>true</code> to the option
<code>byDate</code> within the
<code>group</code> property.
</p>
</div>
</div>
);
}
}