Skip to content

Commit b884d45

Browse files
committed
config(EJ2-000): V18.4.39 Released
1 parent bbe92e4 commit b884d45

File tree

6 files changed

+85
-66
lines changed

6 files changed

+85
-66
lines changed

src/common/sample-list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export let samplesList: any = [
6767
'name': 'Data Grid', 'category': 'Grids', 'order': '03', 'path': 'grid', 'samples': GridSampleOrder, 'type': 'update'
6868
},
6969
{
70-
'name': 'Pivot Table', 'category': 'Grids', 'order': '03', 'path': 'pivot-table', 'samples': PivotViewSampleOrder
70+
'name': 'Pivot Table', 'category': 'Grids', 'order': '03', 'path': 'pivot-table', 'samples': PivotViewSampleOrder, 'type': 'update'
7171
},
7272
{
7373
'name': 'Tree Grid', 'category': 'Grids', 'order': '03', 'path': 'treegrid', 'samples': TreeGridSampleOrder, 'ftName' :'treegrid'

src/pivot-table/aggregation.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class Aggregation extends SampleBase<{}, {}> {
4444
private qData: { [key: string]: Object }[] = [
4545
{ 'value': 'Max', 'text': 'Max' }, { 'value': 'Min', 'text': 'Min' },
4646
{ 'value': 'Count', 'text': 'Count' }, { 'value': 'Sum', 'text': 'Sum' },
47-
{ 'value': 'Avg', 'text': 'Average' }, { 'value': 'DistinctCount', 'text': 'Distinct Count' },
47+
{ 'value': 'Avg', 'text': 'Average' }, { 'value': 'Median', 'text': 'Median' }, { 'value': 'DistinctCount', 'text': 'Distinct Count' },
4848
{ 'value': 'Product', 'text': 'Product' }, { 'value': 'Index', 'text': 'Index' },
4949
{ 'value': 'PopulationStDev', 'text': 'Population StDev' }, { 'value': 'SampleStDev', 'text': 'Sample StDev' },
5050
{ 'value': 'RunningTotals', 'text': 'Running Totals' }, { 'value': 'DifferenceFrom', 'text': 'Difference From' },
@@ -56,7 +56,7 @@ export class Aggregation extends SampleBase<{}, {}> {
5656

5757
private cData: { [key: string]: Object }[] = [
5858
{ 'value': 'Max', 'text': 'Max' }, { 'value': 'Min', 'text': 'Min' },
59-
{ 'value': 'Sum', 'text': 'Sum' }, { 'value': 'Avg', 'text': 'Average' },
59+
{ 'value': 'Sum', 'text': 'Sum' }, { 'value': 'Avg', 'text': 'Average' }, { 'value': 'Median', 'text': 'Median' },
6060
{ 'value': 'Product', 'text': 'Product' }, { 'value': 'Index', 'text': 'Index' },
6161
{ 'value': 'PopulationStDev', 'text': 'Population StDev' }, { 'value': 'SampleStDev', 'text': 'Sample StDev' },
6262
{ 'value': 'RunningTotals', 'text': 'Running Totals' }, { 'value': 'DifferenceFrom', 'text': 'Difference From' },
@@ -145,14 +145,14 @@ export class Aggregation extends SampleBase<{}, {}> {
145145

146146
</div>
147147
<div id="action-description">
148-
<p>This sample demonstrates the aggregate types like sum, average, min, max, count, distinct count, and more in the pivot table for quick business analysis. End users can also change the aggregation type of each field bound to the value axis in the field list at runtime.</p>
148+
<p>This sample demonstrates the aggregate types like sum, average, median, min, max, count, distinct count, and more in the pivot table for quick business analysis. End users can also change the aggregation type of each field bound to the value axis in the field list at runtime.</p>
149149
</div>
150150
<div id="description">
151151
<p>
152152
In this sample, you can change the aggregate types for value fields using the dropdown list separately. The aggregate type can be set using the <code>type</code> property of the value field. The built-in aggregates are:
153153
</p>
154154
<p>
155-
<code>Sum</code>, <code>Average</code>, <code>Min</code>, <code>Max</code>, <code>Count</code>, <code>Distinct Count</code>, <code>Product</code>,
155+
<code>Sum</code>, <code>Average</code>, <code>Median</code>, <code>Min</code>, <code>Max</code>, <code>Count</code>, <code>Distinct Count</code>, <code>Product</code>,
156156
<code>Index</code>, <code>Population StDev</code>, <code>Sample StDev</code>, <code>Population Var</code>, <code>Sample Var</code>, <code>Running Totals</code>,
157157
<code>Difference From</code>, <code>% of Difference From</code>, <code>% of Grand Total</code>, <code>% of Column Total</code>, <code>% of Row Total</code>,
158158
<code>% of Parent Total</code>, <code>% of Parent Column Total</code>, <code>% of Parent Row Total.</code>

src/pivot-table/config.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const PivotViewSampleOrder: Object = [
2121
{ 'path': 'pivot-table/grouping', 'component': 'Grouping', 'description': 'This demo for Essential JS2 Pivot Table control demonstrate the grouping feature for date and number fields', 'name': 'Grouping', 'order': '04', 'category': 'User Interaction', 'api': '{"PivotViewComponent":["DataSource"] }' },
2222
{ 'path': 'pivot-table/tool-bar', 'component': 'PivotToolbar', 'description': 'This demo for Essential JS2 Pivot Table control demonstrate the toolbar feature with pivot table and pivot chart', 'name': 'Toolbar', 'order': '04', 'category': 'User Interaction', 'api': '{"PivotViewComponent":["DataSource"] }' },
2323
{ 'path': 'pivot-table/calculated-field', 'component': 'CalculatedFieldClass', 'description': 'This demo for Essential JS2 Pivot Table control shows calculated field, and it allows users to add calculated items', 'name': 'Calculated Field', 'order': '05', 'category': 'Formula', 'api': '{"PivotViewComponent":["DataSource"] }' },
24-
{ 'path': 'pivot-table/aggregation', 'component': 'Aggregation', 'description': 'This demo for Essential JS2 Pivot Table control shows different types of aggregation for value fields', 'name': 'Aggregation', 'order': '05', 'category': 'Formula', 'api': '{"PivotViewComponent":["DataSource"] }' },
24+
{ 'path': 'pivot-table/aggregation', 'component': 'Aggregation', 'description': 'This demo for Essential JS2 Pivot Table control shows different types of aggregation for value fields', 'name': 'Aggregation', 'order': '05', 'category': 'Formula', 'type': 'update', 'api': '{"PivotViewComponent":["DataSource"] }' },
2525
{ 'path': 'pivot-table/sorting', 'component': 'Sorting', 'description': 'This demo for Essential JS2 Pivot Table control shows ordering(sorting) of fields either in ascending or descending order', 'name': 'Default Sorting', 'order': '06', 'category': 'Sorting', 'api': '{"PivotViewComponent":["DataSource"]}' },
2626
{ 'path': 'pivot-table/value-sorting', 'component': 'ValueSorting', 'description': 'This demo for Essential JS2 Pivot Table control shows sorting values on column or row wise in ascending or descending order', 'name': 'Value Sorting', 'order': '06', 'category': 'Sorting', 'api': '{"PivotViewComponent":["DataSource"] }' },
2727
{ 'path': 'pivot-table/filtering', 'component': 'Filtering', 'description': 'This demo for Essential JS2 Pivot Table control demonstrate member filtering of field headers either by including or excluding them', 'name': 'Default Filtering', 'order': '07', 'category': 'Filtering', 'api': '{"PivotViewComponent":["DataSource"]}' },

src/spreadsheet/cell-template.tsx

Lines changed: 76 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import * as ReactDOM from 'react-dom';
22
import * as React from 'react';
3-
import { SpreadsheetComponent, SheetsDirective, SheetDirective, ColumnsDirective, BeforeSelectEventArgs, CellStyleModel, RowsDirective, RowDirective, CellsDirective, RangesDirective, RangeDirective, CellDirective, getFormatFromType, ColumnDirective, CellRenderEventArgs, ScrollSettingsModel } from '@syncfusion/ej2-react-spreadsheet';
3+
import { SpreadsheetComponent, SheetsDirective, SheetDirective, ColumnsDirective, CellStyleModel, RowsDirective, RowDirective, CellsDirective, RangesDirective, RangeDirective, CellDirective, ColumnDirective, ScrollSettingsModel } from '@syncfusion/ej2-react-spreadsheet';
4+
import { TextBoxComponent } from '@syncfusion/ej2-react-inputs';
5+
import { RadioButtonComponent, ButtonComponent } from '@syncfusion/ej2-react-buttons';
6+
import { DropDownListComponent, MultiSelectComponent } from '@syncfusion/ej2-react-dropdowns';
7+
import { SelectionSettingsModel } from '@syncfusion/ej2-spreadsheet';
48
import { SampleBase } from '../common/sample-base';
59
import './spreadsheet.css';
6-
import { TextBox } from '@syncfusion/ej2-inputs';
7-
import { DatePicker } from '@syncfusion/ej2-calendars';
8-
import { RadioButton } from '@syncfusion/ej2-buttons';
9-
import { DropDownList, MultiSelect } from '@syncfusion/ej2-dropdowns';
1010

1111
/**
1212
* CellTemplate sample
@@ -15,60 +15,74 @@ import { DropDownList, MultiSelect } from '@syncfusion/ej2-dropdowns';
1515
export class CellTemplate extends SampleBase<{}, {}> {
1616
public spreadsheet: SpreadsheetComponent;
1717
public scrollSettings: ScrollSettingsModel = { isFinite: true };
18+
public selectionSettings: SelectionSettingsModel = { mode: 'None' };
1819
public boldCenter: CellStyleModel = { fontWeight: 'bold', textAlign: 'center' , fontSize: '12pt', verticalAlign: 'middle',
1920
textDecoration: 'underline'
2021
};
2122

22-
public onCreated(): void {
23-
this.spreadsheet.cellFormat({ fontWeight: 'bold' }, 'B2:B9');
23+
public nameTextbox(): JSX.Element {
24+
return (
25+
<TextBoxComponent placeholder="Name"></TextBoxComponent>
26+
);
27+
}
28+
29+
public dobTextbox(): JSX.Element {
30+
return (
31+
<TextBoxComponent placeholder="DOB"></TextBoxComponent>
32+
);
2433
}
25-
public beforeSelect(args: BeforeSelectEventArgs): void {
26-
args.cancel = true;
34+
35+
public genderRadioButton(): JSX.Element {
36+
return (
37+
<div>
38+
<RadioButtonComponent name="gender" value="male" label="Male"></RadioButtonComponent>
39+
<RadioButtonComponent name="gender" value="female" label="Female"></RadioButtonComponent>
40+
</div>
41+
);
42+
}
43+
44+
public dropDownList(): JSX.Element {
45+
let experience: string[] = ['0 - 1 year', '1 - 3 years', '3 - 5 years', '5 - 10 years'];
46+
return (
47+
<DropDownListComponent placeholder="Experience" dataSource={experience}></DropDownListComponent>
48+
);
49+
}
50+
51+
public multiSelect(): JSX.Element {
52+
let languages: string[] = ['JAVA', 'C#', 'SQL'];
53+
return (
54+
<MultiSelectComponent placeholder="Areas of Interest" showClearButton={false} dataSource={languages}></MultiSelectComponent>
55+
);
2756
}
28-
public beforeCellRender(args: CellRenderEventArgs): void {
29-
if (this.spreadsheet.activeSheetIndex === 0) {
30-
let target: HTMLInputElement = args.element.firstElementChild as HTMLInputElement;
31-
switch (args.address) {
32-
case 'B1':
33-
(args.element as HTMLTableCellElement).colSpan = 2;
34-
break;
35-
case 'C2':
36-
new TextBox({ placeholder: 'Name' }, target);
37-
break;
38-
case 'C3':
39-
new DatePicker({ placeholder: 'DOB', }, target);
40-
break;
41-
case 'C4':
42-
new RadioButton({ label: 'Male' }, args.element.firstElementChild.firstElementChild as HTMLInputElement);
43-
new RadioButton({ label: 'Female' }, args.element.firstElementChild.lastElementChild as HTMLInputElement);
44-
break;
45-
case 'C5':
46-
let experience: string[] = ['0 - 1 year', '1 - 3 years', '3 - 5 years', '5 - 10 years'];
47-
new DropDownList({
48-
placeholder: 'Experience',
49-
dataSource: experience
50-
}, target);
51-
break;
52-
case 'C6':
53-
let languages: string[] = ['JAVA', 'C#', 'SQL'];
54-
new MultiSelect({
55-
showClearButton: false,
56-
placeholder: 'Areas of Interest',
57-
dataSource: languages
58-
}, target);
59-
break;
60-
case 'C7':
61-
new TextBox({ placeholder: 'Mobile Number' }, target);
62-
break;
63-
case 'C8':
64-
new TextBox({ placeholder: 'Email'}, target);
65-
break;
66-
case 'C9':
67-
new TextBox(null, target);
68-
break;
69-
}
70-
}
7157

58+
public mobileNoTextbox(): JSX.Element {
59+
return (
60+
<TextBoxComponent placeholder="Mobile Number"></TextBoxComponent>
61+
);
62+
}
63+
64+
public emailTextbox(): JSX.Element {
65+
return (
66+
<TextBoxComponent placeholder="Email"></TextBoxComponent>
67+
);
68+
}
69+
70+
public textArea(): JSX.Element {
71+
return (
72+
<TextBoxComponent multiline={true}></TextBoxComponent>
73+
);
74+
}
75+
76+
public button(): JSX.Element {
77+
return (
78+
<ButtonComponent content="Add" style={{float:"right"}} cssClass="e-flat"></ButtonComponent>
79+
);
80+
}
81+
82+
public onCreated(): void {
83+
this.spreadsheet.cellFormat({ fontWeight: 'bold' }, 'B2:B9');
84+
// Merges B1 and C1 cells
85+
this.spreadsheet.merge('B1:C1');
7286
}
7387

7488
render() {
@@ -77,7 +91,7 @@ export class CellTemplate extends SampleBase<{}, {}> {
7791
<div className='control-section spreadsheet-control'>
7892
<SpreadsheetComponent showRibbon={false} showFormulaBar= {false} allowOpen= {false} allowSave= {false}
7993
ref={(ssObj) => { this.spreadsheet = ssObj }} created={this.onCreated.bind(this)} name= {'Candidates List'}
80-
beforeCellRender={this.beforeCellRender.bind(this)} beforeSelect={this.beforeSelect.bind(this)} scrollSettings={this.scrollSettings} >
94+
scrollSettings={this.scrollSettings} allowEditing={false} selectionSettings = {this.selectionSettings}>
8195
<SheetsDirective>
8296
<SheetDirective name='Registration Form' rowCount= {40} colCount= {30} showGridLines= {false}>
8397
<RowsDirective>
@@ -132,11 +146,15 @@ export class CellTemplate extends SampleBase<{}, {}> {
132146
<ColumnDirective width={350}></ColumnDirective>
133147
</ColumnsDirective>
134148
<RangesDirective>
135-
<RangeDirective template='<input />' address='C2:C3'></RangeDirective>
136-
<RangeDirective template= '<div><input type="radio" name="gender" value="male" /><input type="radio" name="gender" value="female"/></div>' address={'C4'}></RangeDirective>
137-
<RangeDirective template='<input />' address='C5:C8'></RangeDirective>
138-
<RangeDirective template='<textarea rows="3"/>' address={'C9'}></RangeDirective>
139-
<RangeDirective template='<button class="e-btn e-flat" style="float:right">Add</button>' address={'C11'}></RangeDirective>
149+
<RangeDirective template={this.nameTextbox} address='C2'></RangeDirective>
150+
<RangeDirective template={this.dobTextbox} address='C3'></RangeDirective>
151+
<RangeDirective template={this.genderRadioButton} address='C4'></RangeDirective>
152+
<RangeDirective template={this.dropDownList} address='C5'></RangeDirective>
153+
<RangeDirective template={this.multiSelect} address='C6'></RangeDirective>
154+
<RangeDirective template={this.mobileNoTextbox} address='C7'></RangeDirective>
155+
<RangeDirective template={this.emailTextbox} address='C8'></RangeDirective>
156+
<RangeDirective template={this.textArea} address='C9'></RangeDirective>
157+
<RangeDirective template={this.button} address='C11'></RangeDirective>
140158
</RangesDirective>
141159
</SheetDirective>
142160
</SheetsDirective>

src/spreadsheet/config.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const SpreadsheetSampleOrder: Object = [
88
{ 'path': 'spreadsheet/number-formatting', 'component': 'NumberFormatting', 'name': 'Number Formatting', 'order': '03', 'category': 'Formatting', 'api': '{"sheets": ["columns", "rows", "name", "selectedRange"], "rows": ["cells"],"cells": ["value", "formatCode"],"range":["dataSource","startCell"]}', 'description': 'This demo for Essential JS 2 Spreadsheet control shows the way of number formatting with minimum configuration.' },
99
{ 'path': 'spreadsheet/conditional-formatting', 'component': 'ConditionalFormatting', 'name': 'Conditional Formatting', 'order': '03', 'category': 'Formatting', 'api': '{"SpreadsheetComponent":["sheets","created" ] }', 'description': 'This example demonstrates about the conditional formatting features like highlight cell rules, data bars,color scales, and icon sets.' },
1010
{ 'path': 'spreadsheet/sorting-and-filtering', 'component': 'SortingAndFiltering', 'name': 'Sorting and Filtering', 'order': '04', 'category': 'Data Analysis', 'api': '{"SpreadsheetComponent":["sheets","showFieldAsHeader","created" ] }', 'description': 'This demo for Essential JS 2 Spreadsheet control shows sorting and filtering feature in ascending and descending order.' },
11-
{ 'path': 'spreadsheet/chart', 'component': 'Chart', 'name': 'Chart', 'order': '05', 'type': 'new', 'category': 'Spreadsheet', 'api': '{"SpreadsheetComponent":["sheets","openUrl","saveUrl","created" ] }', 'description': 'This sample visualizes the data using chart feature by comparing the GDP of different countries with various years' },
12-
{ 'path': 'spreadsheet/image', 'component': 'Image', 'name': 'Image', 'order': '06', 'category': 'Spreadsheet', 'api': '{"SpreadsheetComponent":["sheets","showRibbon","showFormulaBar","created" ] }', 'description': 'This demo for Essential JS 2 Spreadsheet control shows image feature by using weekly Diet planner details.' },
11+
{ 'path': 'spreadsheet/chart', 'component': 'Chart', 'name': 'Chart', 'order': '05', 'type': 'new', 'category': 'Data Visualization', 'api': '{"SpreadsheetComponent":["sheets","openUrl","saveUrl","created" ] }', 'description': 'This sample visualizes the data using chart feature by comparing the GDP of different countries with various years' },
12+
{ 'path': 'spreadsheet/image', 'component': 'Image', 'name': 'Image', 'order': '06', 'category': 'Illustrations', 'api': '{"SpreadsheetComponent":["sheets","showRibbon","showFormulaBar","created" ] }', 'description': 'This demo for Essential JS 2 Spreadsheet control shows image feature by using weekly Diet planner details.' },
1313
{ 'path': 'spreadsheet/cell-template', 'component': 'CellTemplate', 'name': 'Cell Template', 'order': '07', 'category': 'Templates', 'api': '{"SpreadsheetComponent":["sheets","showFieldAsHeader","created" ] }', 'description': 'This demo for Essential JS 2 Spreadsheet control shows cell template featurewith input components like TextBox, DropDownList,RadioButton, MultiSelect etc.' }
1414
];

styles/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,6 +2451,7 @@ RTE toolbar not visible in fullscreen
24512451
}
24522452

24532453
.sb-npm-btn {
2454+
display: none;
24542455
background: #fff;
24552456
border: 1px solid #3c78ef;
24562457
border-radius: 3px;

0 commit comments

Comments
 (0)