|
@import '../node_modules/@syncfusion/ej2-base/styles/material.css';
@import '../node_modules/@syncfusion/ej2-buttons/styles/material.css';
@import '../node_modules/@syncfusion/ej2-calendars/styles/material.css';
@import '../node_modules/@syncfusion/ej2-dropdowns/styles/material.css';
@import '../node_modules/@syncfusion/ej2-inputs/styles/material.css';
@import '../node_modules/@syncfusion/ej2-navigations/styles/material.css';
@import '../node_modules/@syncfusion/ej2-popups/styles/material.css';
@import '../node_modules/@syncfusion/ej2-schedule/styles/material.css';
|
|
<div>
<ejs-multiselect id='groups' [dataSource]='resourceDataSource' [fields]='fields' [mode]='mode' [popupHeight]='popHeight' [showDropDownIcon]='true' showSelectAll='false' [filterBarPlaceholder]='filterPlaceholder'
[value]="value" (change)="onChange($event)"></ejs-multiselect>
</div>
<div>
<ejs-schedule #scheduleObj cssClass='schedule-group' width='100%' height='550px' [selectedDate]="selectedDate" [group]="group"
[eventSettings]="eventSettings" [(currentView)]="scheduleView" (popupOpen)="onPopupOpen($event)" (actionBegin)="onActionBegin($event)" (dataBound)="onDataBound($event)">
<e-resources>
<e-resource field='GroupID' title='Group Name' name='Groups' [allowMultiple]='allowMultiple' [query]='querySource' [dataSource]='resourceDataManager'
textField='GroupName' idField='GroupID' colorField='CalendarColor'>
</e-resource>
</e-resources>
</ejs-schedule>
</div>
|
|
export class AppComponent implements OnInit {
@ViewChild('scheduleObj')
public scheduleObj: ScheduleComponent;
public selectedDate: Date = new Date(2018, 8, 1);
-----------------------
-----------------------
-----------------------
public onChange(args: any) {
// the below line adding the selected resource values in the params and selected resource count in the take
this.scheduleObj.resources[0].query = new Query().addParams("value", args.value.toString()).take(args.value.length);
// In the below line resetting the resource datasource to trigger the server method.
this.scheduleObj.resources[0].dataSource = this.resourceDataManager;
}
public onDataBound(args) {
// Here we used this method to refresh the event window to update the group information properly in the editor window
this.scheduleObj.eventWindow.refresh();
}
}
|