Skip to content

Commit 6578e08

Browse files
Integrated latest changes at 11-21-2024 10:30:18 PM
1 parent 5dab420 commit 6578e08

File tree

20 files changed

+195
-143
lines changed

20 files changed

+195
-143
lines changed

ej2-angular/code-snippet/schedule/data-bind-cs1/src/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BrowserModule } from '@angular/platform-browser'
33
import { ScheduleModule } from '@syncfusion/ej2-angular-schedule'
44
import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
55
import { Component } from '@angular/core';
6-
import { EventSettingsModel, DayService, WeekService, WorkWeekService, MonthService, AgendaService } from '@syncfusion/ej2-angular-schedule';
6+
import { EventSettingsModel, DayService, WeekService, WorkWeekService, MonthService, AgendaService, MonthAgendaService } from '@syncfusion/ej2-angular-schedule';
77

88
@Component({
99
imports: [

ej2-angular/code-snippet/schedule/default-cs22/src/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
66

77

88
import { Component, ViewChild } from '@angular/core';
9-
import { ScheduleComponent, EventSettingsModel, ActionEventArgs, DayService, WeekService, WorkWeekService, MonthService, EventFieldsMapping, AgendaService } from '@syncfusion/ej2-angular-schedule';
9+
import { ScheduleComponent, EventSettingsModel, ActionEventArgs, DayService, WeekService, WorkWeekService, MonthService, EventFieldsMapping, AgendaService, MonthAgendaService } from '@syncfusion/ej2-angular-schedule';
1010
import { scheduleData } from './datasource';
1111

1212
@Component({

ej2-angular/code-snippet/schedule/default-cs23/src/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ButtonModule } from '@syncfusion/ej2-angular-buttons'
66

77

88
import { Component, ViewEncapsulation } from '@angular/core';
9-
import { View, DayService, WeekService, TimelineViewsService, MonthService, WorkWeekService, AgendaService } from '@syncfusion/ej2-angular-schedule';
9+
import { View, DayService, WeekService, TimelineViewsService, MonthService, WorkWeekService, AgendaService, MonthAgendaService } from '@syncfusion/ej2-angular-schedule';
1010

1111
@Component({
1212
imports: [

ej2-angular/code-snippet/schedule/event-cs17/src/app.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414

1515
@Component({
1616
imports: [
17-
1817
ScheduleModule,
1918
TimePickerModule
2019
],
@@ -25,7 +24,7 @@ providers: [DayService,
2524
MonthService,
2625
AgendaService,
2726
MonthAgendaService,
28-
TimelineViewsService, TimelineMonthService]],
27+
TimelineViewsService, TimelineMonthService],
2928
standalone: true,
3029
selector: 'app-root',
3130
// specifies the template string for the Schedule component

ej2-angular/code-snippet/schedule/header-bar-cs1/src/app.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ providers: [DayService,
2323
MonthAgendaService],
2424
standalone: true,
2525
selector: 'app-root',
26-
providers: [DayService, WeekService, WorkWeekService],
2726
// specifies the template string for the Schedule component
2827
template: `<ejs-schedule width='100%' height='550px' [selectedDate]='selectedDate' [views]='views'[eventSettings]='eventSettings' [showHeaderBar]='showHeaderBar'>
2928
</ejs-schedule>`

ej2-angular/code-snippet/schedule/localization-cs2/src/app.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ providers: [DayService,
3939
MonthAgendaService],
4040
standalone: true,
4141
selector: 'app-root',
42-
providers: [DayService, WeekService, WorkWeekService, MonthService, AgendaService],
4342
// specifies the template string for the Schedule component
4443
template: `<ejs-schedule width='100%' height='550px' locale='fr-CH' [selectedDate]='selectedDate'[eventSettings]='eventSettings' [views]='views'></ejs-schedule>`
4544
})

ej2-angular/code-snippet/schedule/multiple-level-resource-cs1/src/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { TimePickerModule } from '@syncfusion/ej2-angular-calendars'
77

88
import { Component } from "@angular/core";
99
import {
10-
WeekService, MonthService, AgendaService, TimelineViewsService, TimelineMonthService,DayService,MonthAgendaService,WorkWeekService
10+
WeekService, MonthService, AgendaService, TimelineViewsService, TimelineMonthService,DayService,MonthAgendaService,WorkWeekService,
1111
EventSettingsModel, GroupModel } from "@syncfusion/ej2-angular-schedule";
1212
import { resourceData } from "./datasource";
1313
@Component({

ej2-angular/code-snippet/schedule/recur-editor-cs3/src/app.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ standalone: true,
2929
<ejs-recurrenceeditor #recurrenceObj [value]="value" (change)="onChange($event)"></ejs-recurrenceeditor>`
3030
})
3131
export class AppComponent {
32-
@ViewChild('recurrenceObj') public recObject: RecurrenceEditor;
32+
@ViewChild('recurrenceObj') public recObject: RecurrenceEditor =
33+
new RecurrenceEditor();
3334
public value = 'FREQ=DAILY;INTERVAL=1';
3435
public dateArray: string[] = [];
3536
public selectRule: string = 'Select Rule';

ej2-angular/code-snippet/schedule/resource-grouping-cs4/src/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NgModule } from '@angular/core'
22
import { BrowserModule } from '@angular/platform-browser'
33
import { ScheduleModule } from '@syncfusion/ej2-angular-schedule'
44
import { TimePickerModule } from '@syncfusion/ej2-angular-calendars'
5-
import { DayService, WeekService, WorkWeekService, MonthService, AgendaService, MonthAgendaServicem, DragAndDropService, View, ScheduleComponent, EventSettingsModel, GroupModel,} from '@syncfusion/ej2-angular-schedule'
5+
import { DayService, WeekService, WorkWeekService, MonthService, AgendaService, MonthAgendaService, DragAndDropService, View, ScheduleComponent, EventSettingsModel, GroupModel,} from '@syncfusion/ej2-angular-schedule'
66

77

88

ej2-angular/code-snippet/schedule/weekend-cell-color/src/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ imports: [
1717
],
1818
standalone: true,
1919
selector: 'app-root',
20-
providers: [View, DayService, WeekService, WorkWeekService, MonthService, AgendaService, ResizeService, DragAndDropService],
20+
providers: [DayService, WeekService, WorkWeekService, MonthService, AgendaService, ResizeService, DragAndDropService],
2121
// specifies the template string for the Schedule component
2222
template: `<ejs-schedule width='100%' height='650px' cssClass='schedule-cell-customization' [selectedDate]="selectedDate" [eventSettings]="eventSettings"
2323
[(currentView)]="currentView" (renderCell)="onRenderCell($event)"></ejs-schedule>`,

ej2-angular/code-snippet/tooltip/ajax-content-cs1/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@angular/platform-browser": "17.1.2",
1515
"@angular/platform-browser-dynamic": "17.1.2",
1616
"@syncfusion/ej2-angular-popups": "*",
17+
"@syncfusion/ej2-angular-lists": "*",
1718
"@syncfusion/ej2-base": "*",
1819
"@syncfusion/ej2-angular-base": "*",
1920
"@angular/animations": "17.1.2",
Lines changed: 65 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
1-
import { NgModule } from '@angular/core'
2-
import { BrowserModule } from '@angular/platform-browser'
3-
import { HttpClientModule } from '@angular/common/http'
4-
import { TooltipModule } from '@syncfusion/ej2-angular-popups'
1+
/**
2+
* Loading ajax content sample
3+
*/
54

5+
import { Component, ViewChild, ViewEncapsulation, Inject } from '@angular/core';
6+
import {
7+
TooltipComponent,
8+
TooltipModule,
9+
} from '@syncfusion/ej2-angular-popups';
10+
import { TooltipEventArgs } from '@syncfusion/ej2-popups';
11+
import { HttpClient } from '@angular/common/http';
612

7-
8-
import { Component, ViewChild, Inject } from '@angular/core';
9-
import { TooltipComponent, TooltipEventArgs } from '@syncfusion/ej2-angular-popups';
10-
import { HttpClient, HttpClientModule } from '@angular/common/http';
11-
13+
import { ListViewModule } from '@syncfusion/ej2-angular-lists';
14+
import { HttpClientModule } from '@angular/common/http';
1215

1316
@Component({
14-
imports: [
15-
16-
HttpClientModule,
17-
TooltipModule
18-
],
19-
20-
21-
standalone: true,
22-
selector: 'my-app',
23-
template: `
17+
selector: 'my-app',
18+
template: `
2419
<div id="tool">
2520
<h4>National Sports</h4>
2621
<ejs-tooltip #tooltip id="tooltip" class="e-prevent-select" content='Loading...' target="#countryList [title]"
@@ -39,67 +34,57 @@ standalone: true,
3934
</ejs-tooltip>
4035
</div>
4136
`,
42-
styles: [`
43-
#countryList {
44-
padding: 5px;
45-
}
46-
47-
#countryList ul {
48-
list-style-type: none;
49-
margin: 0;
50-
padding: 0;
51-
width: 100px;
52-
border: 1px solid #c4c4c4;
53-
}
54-
55-
#countryList li {
56-
padding: 10px;
57-
}
58-
59-
#countryList li:hover {
60-
background-color: #ececec;
61-
}
62-
63-
.contentWrap {
64-
padding: 3px 0;
65-
line-height: 16px;
66-
}
67-
68-
.def {
69-
float: right;
70-
}
71-
#tool {
72-
width: 350px;
73-
position: relative;
74-
left: 50%;
75-
transform: translateX(-25%);
76-
}
77-
`]
37+
encapsulation: ViewEncapsulation.None,
38+
standalone: true,
39+
imports: [TooltipModule, ListViewModule, HttpClientModule],
7840
})
79-
8041
export class AppComponent {
81-
@ViewChild('tooltip')
82-
public tooltipControl: TooltipComponent | any ;
83-
constructor( @Inject(HttpClientModule) public http: HttpClient) { }
84-
85-
onBeforeRender(args: TooltipEventArgs) {
86-
(this as any).http.get('tooltipdata.json')
87-
.map((res: { json: () => any; }) => res.json())
88-
.subscribe(
89-
(result: any) => {
90-
for (let i: number = 0; i < result.length; i++) {
91-
if (result[i].Id === args.target.getAttribute('data-content')) {
92-
this.tooltipControl!.content = "<div class='contentWrap'><div class='def'>" + result[i].Sports + "</div></div>";
93-
}
94-
}
95-
this.tooltipControl!.dataBind();
96-
},
97-
(err: Response) => {
98-
this.tooltipControl!.content = err.statusText;
99-
this.tooltipControl!.dataBind();
100-
});
101-
}
42+
//Define an Array of JSON data
43+
public listViewData: { [key: string]: Object }[] = [
44+
{ id: '1', text: 'Australia' },
45+
{ id: '2', text: 'Bhutan' },
46+
{ id: '3', text: 'China' },
47+
{ id: '4', text: 'Cuba' },
48+
{ id: '5', text: 'India' },
49+
{ id: '6', text: 'Switzerland' },
50+
{ id: '7', text: 'United States' },
51+
];
52+
53+
//Map appropriate columns to fields property
54+
public fields: Object = { text: 'text', tooltip: 'id' };
55+
56+
@ViewChild('tooltip')
57+
public tooltipControl!: TooltipComponent;
58+
59+
constructor(@Inject(HttpClient) public http: HttpClient) {}
60+
61+
/**
62+
* Process tooltip ajax content.
63+
*/
64+
65+
onBeforeRender(args: TooltipEventArgs) {
66+
this.tooltipControl.content = 'Loading...';
67+
this.tooltipControl!.dataBind();
68+
this.http.get('assets/tooltipdata.json').subscribe(
69+
(result: any) => {
70+
for (let i: number = 0; i < result.length; i++) {
71+
if (result[i].Id === args.target.getAttribute('data-content')) {
72+
/* tslint:disable */
73+
this.tooltipControl.content =
74+
"<div class='contentWrap'><span class=" +
75+
result[i].Class +
76+
"></span><div class='def'>" +
77+
result[i].Sports +
78+
'</div></div>';
79+
/* tslint:enable */
80+
}
81+
}
82+
this.tooltipControl!.dataBind();
83+
},
84+
(err: Response) => {
85+
this.tooltipControl.content = err.statusText;
86+
this.tooltipControl!.dataBind();
87+
}
88+
);
89+
}
10290
}
103-
104-
105-
Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
11

22
@import 'node_modules/@syncfusion/ej2-base/styles/material.css';
33
@import 'node_modules/@syncfusion/ej2-angular-popups/styles/material.css';
4-
@import 'node_modules/@syncfusion/ej2-angular-base/styles/material.css';
4+
@import 'node_modules/@syncfusion/ej2-angular-base/styles/material.css';
5+
6+
#countryList {
7+
padding: 5px;
8+
}
9+
10+
#countryList ul {
11+
list-style-type: none;
12+
margin: 0;
13+
padding: 0;
14+
width: 100px;
15+
border: 1px solid #c4c4c4;
16+
}
17+
18+
#countryList li {
19+
padding: 10px;
20+
}
21+
22+
#countryList li:hover {
23+
background-color: #ececec;
24+
}
25+
26+
.contentWrap {
27+
padding: 3px 0;
28+
line-height: 16px;
29+
}
30+
31+
.def {
32+
float: right;
33+
}
34+
#tool {
35+
width: 350px;
36+
position: relative;
37+
left: 50%;
38+
transform: translateX(-25%);
39+
}

0 commit comments

Comments
 (0)