Skip to content

Commit 26bd233

Browse files
Merge pull request #570 from Syncfusion-Content/hotfix/hotfix-v26.1.35
DOCINFRA-2341_merged_using_automation
2 parents 5d17060 + 08ff7be commit 26bd233

File tree

10 files changed

+25742
-615
lines changed

10 files changed

+25742
-615
lines changed
Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
import { NgModule } from '@angular/core'
22
import { BrowserModule } from '@angular/platform-browser'
3+
import { CommonModule } from '@angular/common';
34
import { GridModule, EditService, ToolbarService } from '@syncfusion/ej2-angular-grids'
45
import { ReactiveFormsModule, FormsModule } from '@angular/forms'
56
import { NumericTextBoxAllModule } from '@syncfusion/ej2-angular-inputs'
67
import { DatePickerAllModule } from '@syncfusion/ej2-angular-calendars'
78
import { DropDownListAllModule } from '@syncfusion/ej2-angular-dropdowns'
8-
9-
10-
119
import { Component, OnInit, ViewChild } from '@angular/core';
1210
import { data } from './datasource';
13-
import { DialogEditEventArgs, SaveEventArgs, EditSettingsModel, ToolbarItems } from '@syncfusion/ej2-angular-grids';
11+
import { DialogEditEventArgs, SaveEventArgs} from '@syncfusion/ej2-angular-grids';
1412
import { DataUtil } from '@syncfusion/ej2-data';
1513
import { FormGroup } from '@angular/forms';
1614

1715
@Component({
1816
imports: [
1917

2018
GridModule,
21-
NumericTextBoxAllModule, DatePickerAllModule, DropDownListAllModule, ReactiveFormsModule, FormsModule
19+
NumericTextBoxAllModule, DatePickerAllModule, DropDownListAllModule, BrowserModule,ReactiveFormsModule, FormsModule,CommonModule
2220
],
2321

2422
providers: [EditService, ToolbarService],
@@ -28,56 +26,64 @@ standalone: true,
2826
})
2927
export class AppComponent implements OnInit {
3028

31-
public data?: object[];
32-
public editSettings?: EditSettingsModel;
33-
public toolbar?: ToolbarItems[];
34-
public orderData?: object | any;
35-
@ViewChild('orderForm') public orderForm?: FormGroup;
36-
public shipCityDistinctData?: object[];
37-
public shipCountryDistinctData?: object[];
38-
public pageSettings: any;
29+
public data?: Object[];
30+
public editSettings?: Object;
31+
public toolbar?: string[];
32+
public pageSettings?: Object;
33+
public shipCityDistinctData?: Object[];
34+
public shipCountryDistinctData?: Object[];
35+
public orderData!: IOrderModel;
36+
@ViewChild('orderForm') public orderForm?: FormGroup|any;
3937

40-
ngOnInit(): void {
38+
public ngOnInit(): void {
4139
this.data = data;
42-
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Dialog' };
43-
this.toolbar = ['Add', 'Edit', 'Delete'];
40+
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Normal' };
41+
this.toolbar = ['Add', 'Edit', 'Delete', 'Update', 'Cancel'];
42+
this.pageSettings = { pageCount: 5};
4443
this.shipCityDistinctData = DataUtil.distinct(data, 'ShipCity', true);
4544
this.shipCountryDistinctData = DataUtil.distinct(data, 'ShipCountry', true );
4645
}
4746

4847
actionBegin(args: SaveEventArgs): void {
4948
if (args.requestType === 'beginEdit' || args.requestType === 'add') {
50-
this.orderData = Object.assign({}, args.rowData);;
49+
this.orderData = Object.assign({}, args.rowData);
5150
}
5251
if (args.requestType === 'save') {
53-
if (this.orderForm?.valid) {
52+
if (this.orderForm.valid) {
5453
args.data = this.orderData;
5554
} else {
5655
args.cancel = true;
5756
}
5857
}
59-
}
58+
}
6059

6160
actionComplete(args: DialogEditEventArgs): void {
62-
if ((args.requestType === 'beginEdit' || args.requestType === 'add')) {
63-
(args.form as any).ej2_instances[0].rules = {};
64-
// Set initial Focus
61+
if (args.requestType === 'beginEdit' || args.requestType === 'add') {
62+
// Set initial focus
6563
if (args.requestType === 'beginEdit') {
66-
(args.form?.elements.namedItem('CustomerID') as HTMLInputElement).focus();
64+
((args.form as HTMLFormElement).elements.namedItem('CustomerName') as HTMLInputElement).focus();
65+
} else if (args.requestType === 'add') {
66+
((args.form as HTMLFormElement).elements.namedItem('OrderID') as HTMLInputElement).focus();
6767
}
68+
6869
}
6970
}
70-
}
71+
public focusIn(event: FocusEvent): void {
72+
((event.target as HTMLElement).parentElement as HTMLElement).classList.add('e-input-focus');
73+
}
7174

75+
public focusOut(event: FocusEvent): void {
76+
((event.target as HTMLElement).parentElement as HTMLElement).classList.remove('e-input-focus');
77+
78+
}
79+
80+
}
7281
export interface IOrderModel {
7382
OrderID?: number;
74-
CustomerID?: string;
83+
CustomerName?: string;
7584
ShipCity?: string;
7685
OrderDate?: Date;
7786
Freight?: number;
7887
ShipCountry?: string;
7988
ShipAddress?: string;
80-
}
81-
82-
83-
89+
}
Lines changed: 15 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,154 +1,76 @@
11
export let data: Object[] = [
22
{
3-
OrderID: 10248, CustomerID: 'VINET', EmployeeID: 5, OrderDate: new Date(8364186e5),
3+
OrderID: 10248, CustomerName: 'VINET', EmployeeID: 5, OrderDate: new Date(8364186e5),
44
ShipName: 'Vins et alcools Chevalier', ShipCity: 'Reims', ShipAddress: '59 rue de l Abbaye',
55
ShipRegion: 'CJ', ShipPostalCode: '51100', ShipCountry: 'France', Freight: 32.38, Verified: !0
66
},
77
{
8-
OrderID: 10249, CustomerID: 'TOMSP', EmployeeID: 6, OrderDate: new Date(836505e6),
8+
OrderID: 10249, CustomerName: 'TOMSP', EmployeeID: 6, OrderDate: new Date(836505e6),
99
ShipName: 'Toms Spezialitäten', ShipCity: 'Münster', ShipAddress: 'Luisenstr. 48',
1010
ShipRegion: 'CJ', ShipPostalCode: '44087', ShipCountry: 'Germany', Freight: 11.61, Verified: !1
1111
},
1212
{
13-
OrderID: 10250, CustomerID: 'HANAR', EmployeeID: 4, OrderDate: new Date(8367642e5),
13+
OrderID: 10250, CustomerName: 'HANAR', EmployeeID: 4, OrderDate: new Date(8367642e5),
1414
ShipName: 'Hanari Carnes', ShipCity: 'Rio de Janeiro', ShipAddress: 'Rua do Paço, 67',
1515
ShipRegion: 'RJ', ShipPostalCode: '05454-876', ShipCountry: 'Brazil', Freight: 65.83, Verified: !0
1616
},
1717
{
18-
OrderID: 10251, CustomerID: 'VICTE', EmployeeID: 3, OrderDate: new Date(8367642e5),
18+
OrderID: 10251, CustomerName: 'VICTE', EmployeeID: 3, OrderDate: new Date(8367642e5),
1919
ShipName: 'Victuailles en stock', ShipCity: 'Lyon', ShipAddress: '2, rue du Commerce',
2020
ShipRegion: 'CJ', ShipPostalCode: '69004', ShipCountry: 'France', Freight: 41.34, Verified: !0
2121
},
2222
{
23-
OrderID: 10252, CustomerID: 'SUPRD', EmployeeID: 4, OrderDate: new Date(8368506e5),
23+
OrderID: 10252, CustomerName: 'SUPRD', EmployeeID: 4, OrderDate: new Date(8368506e5),
2424
ShipName: 'Suprêmes délices', ShipCity: 'Charleroi', ShipAddress: 'Boulevard Tirou, 255',
2525
ShipRegion: 'CJ', ShipPostalCode: 'B-6000', ShipCountry: 'Belgium', Freight: 51.3, Verified: !0
2626
},
2727
{
28-
OrderID: 10253, CustomerID: 'HANAR', EmployeeID: 3, OrderDate: new Date(836937e6),
28+
OrderID: 10253, CustomerName: 'HANAR', EmployeeID: 3, OrderDate: new Date(836937e6),
2929
ShipName: 'Hanari Carnes', ShipCity: 'Rio de Janeiro', ShipAddress: 'Rua do Paço, 67',
3030
ShipRegion: 'RJ', ShipPostalCode: '05454-876', ShipCountry: 'Brazil', Freight: 58.17, Verified: !0
3131
},
3232
{
33-
OrderID: 10254, CustomerID: 'CHOPS', EmployeeID: 5, OrderDate: new Date(8370234e5),
33+
OrderID: 10254, CustomerName: 'CHOPS', EmployeeID: 5, OrderDate: new Date(8370234e5),
3434
ShipName: 'Chop-suey Chinese', ShipCity: 'Bern', ShipAddress: 'Hauptstr. 31',
3535
ShipRegion: 'CJ', ShipPostalCode: '3012', ShipCountry: 'Switzerland', Freight: 22.98, Verified: !1
3636
},
3737
{
38-
OrderID: 10255, CustomerID: 'RICSU', EmployeeID: 9, OrderDate: new Date(8371098e5),
38+
OrderID: 10255, CustomerName: 'RICSU', EmployeeID: 9, OrderDate: new Date(8371098e5),
3939
ShipName: 'Richter Supermarkt', ShipCity: 'Genève', ShipAddress: 'Starenweg 5',
4040
ShipRegion: 'CJ', ShipPostalCode: '1204', ShipCountry: 'Switzerland', Freight: 148.33, Verified: !0
4141
},
4242
{
43-
OrderID: 10256, CustomerID: 'WELLI', EmployeeID: 3, OrderDate: new Date(837369e6),
43+
OrderID: 10256, CustomerName: 'WELLI', EmployeeID: 3, OrderDate: new Date(837369e6),
4444
ShipName: 'Wellington Importadora', ShipCity: 'Resende', ShipAddress: 'Rua do Mercado, 12',
4545
ShipRegion: 'SP', ShipPostalCode: '08737-363', ShipCountry: 'Brazil', Freight: 13.97, Verified: !1
4646
},
4747
{
48-
OrderID: 10257, CustomerID: 'HILAA', EmployeeID: 4, OrderDate: new Date(8374554e5),
48+
OrderID: 10257, CustomerName: 'HILAA', EmployeeID: 4, OrderDate: new Date(8374554e5),
4949
ShipName: 'HILARION-Abastos', ShipCity: 'San Cristóbal', ShipAddress: 'Carrera 22 con Ave. Carlos Soublette #8-35',
5050
ShipRegion: 'Táchira', ShipPostalCode: '5022', ShipCountry: 'Venezuela', Freight: 81.91, Verified: !0
5151
},
5252
{
53-
OrderID: 10258, CustomerID: 'ERNSH', EmployeeID: 1, OrderDate: new Date(8375418e5),
53+
OrderID: 10258, CustomerName: 'ERNSH', EmployeeID: 1, OrderDate: new Date(8375418e5),
5454
ShipName: 'Ernst Handel', ShipCity: 'Graz', ShipAddress: 'Kirchgasse 6',
5555
ShipRegion: 'CJ', ShipPostalCode: '8010', ShipCountry: 'Austria', Freight: 140.51, Verified: !0
5656
},
5757
{
58-
OrderID: 10259, CustomerID: 'CENTC', EmployeeID: 4, OrderDate: new Date(8376282e5),
58+
OrderID: 10259, CustomerName: 'CENTC', EmployeeID: 4, OrderDate: new Date(8376282e5),
5959
ShipName: 'Centro comercial Moctezuma', ShipCity: 'México D.F.', ShipAddress: 'Sierras de Granada 9993',
6060
ShipRegion: 'CJ', ShipPostalCode: '05022', ShipCountry: 'Mexico', Freight: 3.25, Verified: !1
6161
},
6262
{
63-
OrderID: 10260, CustomerID: 'OTTIK', EmployeeID: 4, OrderDate: new Date(8377146e5),
63+
OrderID: 10260, CustomerName: 'OTTIK', EmployeeID: 4, OrderDate: new Date(8377146e5),
6464
ShipName: 'Ottilies Käseladen', ShipCity: 'Köln', ShipAddress: 'Mehrheimerstr. 369',
6565
ShipRegion: 'CJ', ShipPostalCode: '50739', ShipCountry: 'Germany', Freight: 55.09, Verified: !0
6666
},
6767
{
68-
OrderID: 10261, CustomerID: 'QUEDE', EmployeeID: 4, OrderDate: new Date(8377146e5),
68+
OrderID: 10261, CustomerName: 'QUEDE', EmployeeID: 4, OrderDate: new Date(8377146e5),
6969
ShipName: 'Que Delícia', ShipCity: 'Rio de Janeiro', ShipAddress: 'Rua da Panificadora, 12',
7070
ShipRegion: 'RJ', ShipPostalCode: '02389-673', ShipCountry: 'Brazil', Freight: 3.05, Verified: !1
7171
},
7272
{
73-
OrderID: 10262, CustomerID: 'RATTC', EmployeeID: 8, OrderDate: new Date(8379738e5),
73+
OrderID: 10262, CustomerName: 'RATTC', EmployeeID: 8, OrderDate: new Date(8379738e5),
7474
ShipName: 'Rattlesnake Canyon Grocery', ShipCity: 'Albuquerque', ShipAddress: '2817 Milton Dr.',
7575
ShipRegion: 'NM', ShipPostalCode: '87110', ShipCountry: 'USA', Freight: 48.29, Verified: !0
7676
}];
77-
78-
79-
export let cascadeData: Object[] = [
80-
{
81-
OrderID: 10248, CustomerID: 'VINET', EmployeeID: 5, OrderDate: new Date(8364186e5),
82-
ShipName: 'Vins et alcools Chevalier', ShipCity: 'Reims', ShipAddress: '59 rue de l Abbaye',
83-
ShipRegion: 'CJ', ShipPostalCode: '51100', ShipCountry: 'Australia', ShipState: 'Queensland', Freight: 32.38, Verified: !0
84-
},
85-
{
86-
OrderID: 10249, CustomerID: 'TOMSP', EmployeeID: 6, OrderDate: new Date(836505e6),
87-
ShipName: 'Toms Spezialitäten', ShipCity: 'Münster', ShipAddress: 'Luisenstr. 48',
88-
ShipRegion: 'CJ', ShipPostalCode: '44087', ShipCountry: 'Australia', ShipState: 'Tasmania', Freight: 11.61, Verified: !1
89-
},
90-
{
91-
OrderID: 10250, CustomerID: 'HANAR', EmployeeID: 4, OrderDate: new Date(8367642e5),
92-
ShipName: 'Hanari Carnes', ShipCity: 'Rio de Janeiro', ShipAddress: 'Rua do Paço, 67',
93-
ShipRegion: 'RJ', ShipPostalCode: '05454-876', ShipCountry: 'United States', ShipState: 'New York', Freight: 65.83, Verified: !0
94-
},
95-
{
96-
OrderID: 10251, CustomerID: 'VICTE', EmployeeID: 3, OrderDate: new Date(8367642e5),
97-
ShipName: 'Victuailles en stock', ShipCity: 'Lyon', ShipAddress: '2, rue du Commerce',
98-
ShipRegion: 'CJ', ShipPostalCode: '69004', ShipCountry: 'Australia', ShipState: 'Queensland', Freight: 41.34, Verified: !0
99-
},
100-
{
101-
OrderID: 10252, CustomerID: 'SUPRD', EmployeeID: 2, OrderDate: new Date(8368506e5),
102-
ShipName: 'Suprêmes délices', ShipCity: 'Charleroi', ShipAddress: 'Boulevard Tirou, 255',
103-
ShipRegion: 'CJ', ShipPostalCode: 'B-6000', ShipCountry: 'United States', ShipState: 'New York', Freight: 51.3, Verified: !0
104-
},
105-
{
106-
OrderID: 10253, CustomerID: 'HANAR', EmployeeID: 7, OrderDate: new Date(836937e6),
107-
ShipName: 'Hanari Carnes', ShipCity: 'Rio de Janeiro', ShipAddress: 'Rua do Paço, 67',
108-
ShipRegion: 'RJ', ShipPostalCode: '05454-876', ShipCountry: 'United States', ShipState: 'New York', Freight: 58.17, Verified: !0
109-
},
110-
{
111-
OrderID: 10254, CustomerID: 'CHOPS', EmployeeID: 5, OrderDate: new Date(8370234e5),
112-
ShipName: 'Chop-suey Chinese', ShipCity: 'Bern', ShipAddress: 'Hauptstr. 31',
113-
ShipRegion: 'CJ', ShipPostalCode: '3012', ShipCountry: 'United States', ShipState: 'Virginia', Freight: 22.98, Verified: !1
114-
},
115-
{
116-
OrderID: 10255, CustomerID: 'RICSU', EmployeeID: 9, OrderDate: new Date(8371098e5),
117-
ShipName: 'Richter Supermarkt', ShipCity: 'Genève', ShipAddress: 'Starenweg 5',
118-
ShipRegion: 'CJ', ShipPostalCode: '1204', ShipCountry: 'Australia', ShipState: 'Tasmania', Freight: 148.33, Verified: !0
119-
},
120-
{
121-
OrderID: 10256, CustomerID: 'WELLI', EmployeeID: 3, OrderDate: new Date(837369e6),
122-
ShipName: 'Wellington Importadora', ShipCity: 'Resende', ShipAddress: 'Rua do Mercado, 12',
123-
ShipRegion: 'SP', ShipPostalCode: '08737-363', ShipCountry: 'United States', ShipState: 'Virginia', Freight: 13.97, Verified: !1
124-
},
125-
{
126-
OrderID: 10257, CustomerID: 'HILAA', EmployeeID: 4, OrderDate: new Date(8374554e5),
127-
ShipName: 'HILARION-Abastos', ShipCity: 'San Cristóbal', ShipAddress: 'Carrera 22 con Ave. Carlos Soublette #8-35',
128-
ShipRegion: 'Táchira', ShipPostalCode: '5022', ShipCountry: 'United States', ShipState: 'Virginia', Freight: 81.91, Verified: !0
129-
},
130-
{
131-
OrderID: 10258, CustomerID: 'ERNSH', EmployeeID: 1, OrderDate: new Date(8375418e5),
132-
ShipName: 'Ernst Handel', ShipCity: 'Graz', ShipAddress: 'Kirchgasse 6',
133-
ShipRegion: 'CJ', ShipPostalCode: '8010', ShipCountry: 'United States', ShipState: 'Washington', Freight: 140.51, Verified: !0
134-
},
135-
{
136-
OrderID: 10259, CustomerID: 'CENTC', EmployeeID: 4, OrderDate: new Date(8376282e5),
137-
ShipName: 'Centro comercial Moctezuma', ShipCity: 'México D.F.', ShipAddress: 'Sierras de Granada 9993',
138-
ShipRegion: 'CJ', ShipPostalCode: '05022', ShipCountry: 'United States', ShipState: 'Washington', Freight: 3.25, Verified: !1
139-
},
140-
{
141-
OrderID: 10260, CustomerID: 'OTTIK', EmployeeID: 4, OrderDate: new Date(8377146e5),
142-
ShipName: 'Ottilies Käseladen', ShipCity: 'Köln', ShipAddress: 'Mehrheimerstr. 369',
143-
ShipRegion: 'CJ', ShipPostalCode: '50739', ShipCountry: 'Australia', ShipState: 'Victoria', Freight: 55.09, Verified: !0
144-
},
145-
{
146-
OrderID: 10261, CustomerID: 'QUEDE', EmployeeID: 4, OrderDate: new Date(8377146e5),
147-
ShipName: 'Que Delícia', ShipCity: 'Rio de Janeiro', ShipAddress: 'Rua da Panificadora, 12',
148-
ShipRegion: 'RJ', ShipPostalCode: '02389-673', ShipCountry: 'United States', ShipState: 'Washington', Freight: 3.05, Verified: !1
149-
},
150-
{
151-
OrderID: 10262, CustomerID: 'RATTC', EmployeeID: 8, OrderDate: new Date(8379738e5),
152-
ShipName: 'Rattlesnake Canyon Grocery', ShipCity: 'Albuquerque', ShipAddress: '2817 Milton Dr.',
153-
ShipRegion: 'NM', ShipPostalCode: '87110', ShipCountry: 'Australia', ShipState: 'Victoria', Freight: 48.29, Verified: !0
154-
}];

0 commit comments

Comments
 (0)