Skip to content

Commit 0bc7673

Browse files
Merge pull request #8 from DevExpress-Examples/fixingExample_25.1.3
Fixing example 25.1.3
2 parents 4c5df4e + 7eb8f3c commit 0bc7673

File tree

17 files changed

+8126
-509
lines changed

17 files changed

+8126
-509
lines changed

Angular/package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@
5050
"stylelint-scss": "^5.0.0",
5151
"typescript": "~5.4.5"
5252
}
53-
}
53+
}

Angular/src/app/app.component.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<dx-data-grid
22
[dataSource]="employees"
3-
(onEditorPreparing)="onEditorPreparing($event)">
4-
<dxo-editing
5-
[allowUpdating]="true"
6-
[allowAdding]="true">
7-
</dxo-editing>
3+
(onEditorPreparing)="onEditorPreparing($event)"
4+
>
5+
<dxo-editing [allowUpdating]="true" [allowAdding]="true"> </dxo-editing>
86

97
<dxi-column
108
caption="Name"
119
dataField="CustomerID"
12-
[setCellValue]="setCellValue">
10+
[setCellValue]="setCellValue"
11+
>
1312
<dxo-lookup
1413
[dataSource]="customers"
1514
valueExpr="CustomerID"
16-
displayExpr="CustomerName">
15+
displayExpr="CustomerName"
16+
>
1717
</dxo-lookup>
1818
</dxi-column>
1919
<dxi-column dataField="Address"></dxi-column>

Angular/src/app/app.component.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
import { Component, OnInit, ViewChild } from '@angular/core';
2-
import type { Customer, Employee } from './types';
32
import { DxDataGridComponent, type DxDataGridTypes } from 'devextreme-angular/ui/data-grid';
43
import type { ValueChangedEvent } from 'devextreme/ui/lookup';
4+
import type { Customer, Employee } from './types';
55
import { AppService } from './app.service';
66

77
@Component({
88
selector: 'app-root',
99
templateUrl: './app.component.html',
10-
styleUrls: ['./app.component.scss']
10+
styleUrls: ['./app.component.scss'],
1111
})
1212
export class AppComponent implements OnInit {
1313
@ViewChild(DxDataGridComponent) dataGrid!: DxDataGridComponent<Employee, number>;
14+
1415
employees: Employee[] = [];
16+
1517
customers: Customer[] = [];
1618

17-
constructor(private service: AppService) {}
19+
constructor(private readonly service: AppService) {}
1820

1921
ngOnInit(): void {
2022
this.employees = this.service.getEmployees();

Angular/src/app/app.service.ts

Lines changed: 145 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -2,121 +2,151 @@ import { Injectable } from '@angular/core';
22
import type { Customer, Employee } from './types';
33

44
@Injectable({
5-
providedIn: 'root'
5+
providedIn: 'root',
66
})
77
export class AppService {
8-
getEmployees(): Employee[] {
9-
return [
10-
{ ID: 1, CustomerID: 1, Address: "Markušica", Phone: "+385 674 958 1641" },
11-
{ ID: 2, CustomerID: 2, Address: "Itaberaí", Phone: "+55 491 329 4084" },
12-
{ ID: 3, CustomerID: 3, Address: "Volgograd", Phone: "+7 745 619 7799" },
13-
{ ID: 4, CustomerID: 4, Address: "Shuiyin", Phone: "+86 774 746 9874" },
14-
{ ID: 5, CustomerID: 5, Address: "Baturaden", Phone: "+62 113 149 9397" },
15-
{ ID: 6, CustomerID: 6, Address: "New York City", Phone: "+1 917 528 7751" },
16-
{ ID: 7, CustomerID: 7, Address: "Adolfo Lopez Mateos", Phone: "+52 626 244 6757"},
17-
{ ID: 8, CustomerID: 8, Address: "Nong Khae", Phone: "+66 326 375 8694" },
18-
{ ID: 9, CustomerID: 9, Address: "Znamenskoye", Phone: "+7 926 141 2517" },
19-
{ ID: 10, CustomerID: 10, Address: "Patpata Segundo", Phone: "+63 428 750 7737" },
20-
{ ID: 11, CustomerID: 11, Address: "Fontanka", Phone: "+380 557 509 4191" },
21-
{ ID: 12, CustomerID: 12, Address: "Novosil'", Phone: "+7 493 632 2768" },
22-
{ ID: 13, CustomerID: 13, Address: "Ubinskoye", Phone: "+7 954 353 8930" },
23-
{ ID: 14, CustomerID: 14, Address: "Protvino", Phone: "+7 386 362 2407" },
24-
{ ID: 15, CustomerID: 15, Address: "Santa Fé do Sul", Phone: "+55 867 691 7097" }
25-
];
26-
}
8+
getEmployees(): Employee[] {
9+
return [
10+
{
11+
ID: 1, CustomerID: 1, Address: 'Markušica', Phone: '+385 674 958 1641',
12+
},
13+
{
14+
ID: 2, CustomerID: 2, Address: 'Itaberaí', Phone: '+55 491 329 4084',
15+
},
16+
{
17+
ID: 3, CustomerID: 3, Address: 'Volgograd', Phone: '+7 745 619 7799',
18+
},
19+
{
20+
ID: 4, CustomerID: 4, Address: 'Shuiyin', Phone: '+86 774 746 9874',
21+
},
22+
{
23+
ID: 5, CustomerID: 5, Address: 'Baturaden', Phone: '+62 113 149 9397',
24+
},
25+
{
26+
ID: 6, CustomerID: 6, Address: 'New York City', Phone: '+1 917 528 7751',
27+
},
28+
{
29+
ID: 7, CustomerID: 7, Address: 'Adolfo Lopez Mateos', Phone: '+52 626 244 6757',
30+
},
31+
{
32+
ID: 8, CustomerID: 8, Address: 'Nong Khae', Phone: '+66 326 375 8694',
33+
},
34+
{
35+
ID: 9, CustomerID: 9, Address: 'Znamenskoye', Phone: '+7 926 141 2517',
36+
},
37+
{
38+
ID: 10, CustomerID: 10, Address: 'Patpata Segundo', Phone: '+63 428 750 7737',
39+
},
40+
{
41+
ID: 11, CustomerID: 11, Address: 'Fontanka', Phone: '+380 557 509 4191',
42+
},
43+
{
44+
ID: 12, CustomerID: 12, Address: 'Novosil\'', Phone: '+7 493 632 2768',
45+
},
46+
{
47+
ID: 13, CustomerID: 13, Address: 'Ubinskoye', Phone: '+7 954 353 8930',
48+
},
49+
{
50+
ID: 14, CustomerID: 14, Address: 'Protvino', Phone: '+7 386 362 2407',
51+
},
52+
{
53+
ID: 15, CustomerID: 15, Address: 'Santa Fé do Sul', Phone: '+55 867 691 7097',
54+
},
55+
];
56+
}
2757

28-
getCustomers(): Customer[] {
29-
return [
30-
{
31-
CustomerID: 1,
32-
CustomerName: "Kaela Phonix",
33-
Address: "Markušica",
34-
Phone: "+385 674 958 1641"
35-
},
36-
{
37-
CustomerID: 2,
38-
CustomerName: "Dotty Hearnden",
39-
Address: "Itaberaí",
40-
Phone: "+55 491 329 4084"
41-
},
42-
{
43-
CustomerID: 3,
44-
CustomerName: "Alasdair Greenin",
45-
Address: "Volgograd",
46-
Phone: "+7 657 495 7659"
47-
},
48-
{
49-
CustomerID: 4,
50-
CustomerName: "Stoddard Laidlaw",
51-
Address: "Shuiyin",
52-
Phone: "+86 774 746 9874"
53-
},
54-
{
55-
CustomerID: 5,
56-
CustomerName: "Damiano Gencke",
57-
Address: "Baturaden",
58-
Phone: "+62 113 149 9397"
59-
},
60-
{
61-
CustomerID: 6,
62-
CustomerName: "Aura Bavidge",
63-
Address: "New York City",
64-
Phone: "+1 917 528 7751"
65-
},
66-
{
67-
CustomerID: 7,
68-
CustomerName: "Emmanuel Chedgey",
69-
Address: "Adolfo Lopez Mateos",
70-
Phone: "+52 626 244 6757"
71-
},
72-
{
73-
CustomerID: 8,
74-
CustomerName: "Clerkclaude Pargeter",
75-
Address: "Nong Khae",
76-
Phone: "+66 326 375 8694"
77-
},
78-
{
79-
CustomerID: 9,
80-
CustomerName: "Onfroi Cinnamond",
81-
Address: "Znamenskoye",
82-
Phone: "+7 926 141 2517"
83-
},
84-
{
85-
CustomerID: 10,
86-
CustomerName: "Madlin Kopke",
87-
Address: "Patpata Segundo",
88-
Phone: "+63 428 750 7737"
89-
},
90-
{
91-
CustomerID: 11,
92-
CustomerName: "Mortie Feary",
93-
Address: "Fontanka",
94-
Phone: "+380 557 509 4191"
95-
},
96-
{
97-
CustomerID: 12,
98-
CustomerName: "Colet Haitlie",
99-
Address: "Novosil'",
100-
Phone: "+7 493 632 2768"
101-
},
102-
{
103-
CustomerID: 13,
104-
CustomerName: "Pippy Carnell",
105-
Address: "Ubinskoye",
106-
Phone: "+7 954 353 8930"
107-
},
108-
{
109-
CustomerID: 14,
110-
CustomerName: "Arvie Midden",
111-
Address: "Protvino",
112-
Phone: "+7 386 362 2407"
113-
},
114-
{
115-
CustomerID: 15,
116-
CustomerName: "Brook Kamena",
117-
Address: "Santa Fé do Sul",
118-
Phone: "+55 867 691 7097"
119-
}
120-
];
121-
}
122-
}
58+
getCustomers(): Customer[] {
59+
return [
60+
{
61+
CustomerID: 1,
62+
CustomerName: 'Kaela Phonix',
63+
Address: 'Markušica',
64+
Phone: '+385 674 958 1641',
65+
},
66+
{
67+
CustomerID: 2,
68+
CustomerName: 'Dotty Hearnden',
69+
Address: 'Itaberaí',
70+
Phone: '+55 491 329 4084',
71+
},
72+
{
73+
CustomerID: 3,
74+
CustomerName: 'Alasdair Greenin',
75+
Address: 'Volgograd',
76+
Phone: '+7 657 495 7659',
77+
},
78+
{
79+
CustomerID: 4,
80+
CustomerName: 'Stoddard Laidlaw',
81+
Address: 'Shuiyin',
82+
Phone: '+86 774 746 9874',
83+
},
84+
{
85+
CustomerID: 5,
86+
CustomerName: 'Damiano Gencke',
87+
Address: 'Baturaden',
88+
Phone: '+62 113 149 9397',
89+
},
90+
{
91+
CustomerID: 6,
92+
CustomerName: 'Aura Bavidge',
93+
Address: 'New York City',
94+
Phone: '+1 917 528 7751',
95+
},
96+
{
97+
CustomerID: 7,
98+
CustomerName: 'Emmanuel Chedgey',
99+
Address: 'Adolfo Lopez Mateos',
100+
Phone: '+52 626 244 6757',
101+
},
102+
{
103+
CustomerID: 8,
104+
CustomerName: 'Clerkclaude Pargeter',
105+
Address: 'Nong Khae',
106+
Phone: '+66 326 375 8694',
107+
},
108+
{
109+
CustomerID: 9,
110+
CustomerName: 'Onfroi Cinnamond',
111+
Address: 'Znamenskoye',
112+
Phone: '+7 926 141 2517',
113+
},
114+
{
115+
CustomerID: 10,
116+
CustomerName: 'Madlin Kopke',
117+
Address: 'Patpata Segundo',
118+
Phone: '+63 428 750 7737',
119+
},
120+
{
121+
CustomerID: 11,
122+
CustomerName: 'Mortie Feary',
123+
Address: 'Fontanka',
124+
Phone: '+380 557 509 4191',
125+
},
126+
{
127+
CustomerID: 12,
128+
CustomerName: 'Colet Haitlie',
129+
Address: 'Novosil\'',
130+
Phone: '+7 493 632 2768',
131+
},
132+
{
133+
CustomerID: 13,
134+
CustomerName: 'Pippy Carnell',
135+
Address: 'Ubinskoye',
136+
Phone: '+7 954 353 8930',
137+
},
138+
{
139+
CustomerID: 14,
140+
CustomerName: 'Arvie Midden',
141+
Address: 'Protvino',
142+
Phone: '+7 386 362 2407',
143+
},
144+
{
145+
CustomerID: 15,
146+
CustomerName: 'Brook Kamena',
147+
Address: 'Santa Fé do Sul',
148+
Phone: '+55 867 691 7097',
149+
},
150+
];
151+
}
152+
}

Angular/src/app/types.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
export interface Customer {
2-
CustomerID: number;
3-
CustomerName: string;
4-
Address: string;
5-
Phone: string;
2+
CustomerID: number;
3+
CustomerName: string;
4+
Address: string;
5+
Phone: string;
66
}
77

88
export interface Employee {
9-
ID: number;
10-
CustomerID: number;
11-
Address: string;
12-
Phone: string;
13-
}
9+
ID: number;
10+
CustomerID: number;
11+
Address: string;
12+
Phone: string;
13+
}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<!-- default badges list -->
2-
![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/320638680/25.1.3%2B)
32
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T957230)
43
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
54
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)

0 commit comments

Comments
 (0)