Commit e5815db4 by Nattana Chaiyamat

แก้ไข pivot ให้ใช้งานได้

parent 81a24eca
......@@ -27,6 +27,7 @@
"@swimlane/ngx-charts": "^16.0.0",
"@swimlane/ngx-datatable": "^17.0.0",
"@syncfusion/ej2-angular-base": "^29.2.4",
"@syncfusion/ej2-angular-charts": "^29.2.4",
"@syncfusion/ej2-angular-dropdowns": "^29.2.4",
"@syncfusion/ej2-angular-grids": "^29.2.4",
"@syncfusion/ej2-angular-inputs": "^29.2.4",
......@@ -3959,15 +3960,25 @@
}
},
"node_modules/@syncfusion/ej2-angular-base": {
"version": "29.2.4",
"resolved": "https://registry.npmjs.org/@syncfusion/ej2-angular-base/-/ej2-angular-base-29.2.4.tgz",
"integrity": "sha512-6SiGkjKOy/9RwfkFNKCix5OjoZkN7bqN+76S0+0FOP67fLH9DYcDvwkkSd7tVNAHnEbfSh8SV5oSjEm4hvYSNQ==",
"version": "29.2.10",
"resolved": "https://registry.npmjs.org/@syncfusion/ej2-angular-base/-/ej2-angular-base-29.2.10.tgz",
"integrity": "sha512-jU9K1pybX7CLEkWO7ufQmGKuSBWl1rsUOm9x04BLonGNUp6fSUXOqN1niruhhOE1ZlSHGqzKp1PTjR6EmMe6Xw==",
"hasInstallScript": true,
"dependencies": {
"@syncfusion/ej2-base": "~29.2.4",
"@syncfusion/ej2-icons": "~29.2.4"
}
},
"node_modules/@syncfusion/ej2-angular-charts": {
"version": "29.2.11",
"resolved": "https://registry.npmjs.org/@syncfusion/ej2-angular-charts/-/ej2-angular-charts-29.2.11.tgz",
"integrity": "sha512-cO4vSTpDQxy4rdvEb1OlSRT2270YCBAUH9pdz9EhZI4lz3XCgcXL/ztv4D3V2MggvPQWU9yOpqjKv1Hg9EwrvQ==",
"dependencies": {
"@syncfusion/ej2-angular-base": "~29.2.10",
"@syncfusion/ej2-base": "~29.2.11",
"@syncfusion/ej2-charts": "29.2.11"
}
},
"node_modules/@syncfusion/ej2-angular-dropdowns": {
"version": "29.2.7",
"resolved": "https://registry.npmjs.org/@syncfusion/ej2-angular-dropdowns/-/ej2-angular-dropdowns-29.2.7.tgz",
......@@ -4009,9 +4020,9 @@
}
},
"node_modules/@syncfusion/ej2-base": {
"version": "29.2.4",
"resolved": "https://registry.npmjs.org/@syncfusion/ej2-base/-/ej2-base-29.2.4.tgz",
"integrity": "sha512-ka+ClGOvb4RzyPq5sveOO8TUMjIvSOBwExnbOG47YwMrC0RGJSNc6wJlhtm+6ZtmHx457oyH7c/WEj5wfV2B4w==",
"version": "29.2.11",
"resolved": "https://registry.npmjs.org/@syncfusion/ej2-base/-/ej2-base-29.2.11.tgz",
"integrity": "sha512-f1yM+6606zde7MR4q4d/q6foR3viHDA1/SkkTbLVwBME7I/0AcMG/i0eeTWJfJS8dgn91DGrsrEl0nZ9IA1CEQ==",
"dependencies": {
"@syncfusion/ej2-icons": "~29.2.4"
},
......@@ -4028,27 +4039,27 @@
}
},
"node_modules/@syncfusion/ej2-calendars": {
"version": "29.2.5",
"resolved": "https://registry.npmjs.org/@syncfusion/ej2-calendars/-/ej2-calendars-29.2.5.tgz",
"integrity": "sha512-CIKB1ZMGasgau7E0FWJqrYV0dUQ0MCWlESrMnWFZ5sncsFHRVit7+JVgZdwZfmGKTPZuatq+ACUYOMJS0Le76g==",
"version": "29.2.11",
"resolved": "https://registry.npmjs.org/@syncfusion/ej2-calendars/-/ej2-calendars-29.2.11.tgz",
"integrity": "sha512-RphIYxXwaDv59QiYjswIntNyDxOqd3oQqi2G9Z3zRD+Ez1u+ybY9koaWbj5Dq/5AsFhdNCwHhyEPX9gACZMsvA==",
"dependencies": {
"@syncfusion/ej2-base": "~29.2.4",
"@syncfusion/ej2-base": "~29.2.11",
"@syncfusion/ej2-buttons": "~29.2.5",
"@syncfusion/ej2-inputs": "~29.2.5",
"@syncfusion/ej2-lists": "~29.2.4",
"@syncfusion/ej2-popups": "~29.2.4"
"@syncfusion/ej2-popups": "~29.2.8"
}
},
"node_modules/@syncfusion/ej2-charts": {
"version": "29.2.5",
"resolved": "https://registry.npmjs.org/@syncfusion/ej2-charts/-/ej2-charts-29.2.5.tgz",
"integrity": "sha512-IM/aGWa3ldXrXZAR8b4cT3nkCuhQyNHvIIxnPRR92Su6nA55gY12ORlQu4AURfLef+QPZe2DXqdjbhWXqFTJ3w==",
"version": "29.2.11",
"resolved": "https://registry.npmjs.org/@syncfusion/ej2-charts/-/ej2-charts-29.2.11.tgz",
"integrity": "sha512-OJ3BlnrPVC/p2rEQvv2l9RtjnAAZu8aszLVVuWlXi3ivjbt9MZb4AiA6f8alHDxKFbfUKoOnTnx/wGLNHUqmTA==",
"dependencies": {
"@syncfusion/ej2-base": "~29.2.4",
"@syncfusion/ej2-calendars": "~29.2.5",
"@syncfusion/ej2-base": "~29.2.11",
"@syncfusion/ej2-calendars": "~29.2.11",
"@syncfusion/ej2-data": "~29.2.4",
"@syncfusion/ej2-excel-export": "~29.2.4",
"@syncfusion/ej2-navigations": "~29.2.5",
"@syncfusion/ej2-navigations": "~29.2.8",
"@syncfusion/ej2-pdf-export": "~29.2.4",
"@syncfusion/ej2-svg-base": "~29.2.4"
}
......@@ -4147,16 +4158,16 @@
}
},
"node_modules/@syncfusion/ej2-navigations": {
"version": "29.2.7",
"resolved": "https://registry.npmjs.org/@syncfusion/ej2-navigations/-/ej2-navigations-29.2.7.tgz",
"integrity": "sha512-5rSAS56RH4zWS5caIRtenf1gPauJTf2nZ/Cbs/6Lf2xzqfFeWTNKdYl9nNIszHAn/76v+Kmzn89cBoqAwfkeRA==",
"version": "29.2.8",
"resolved": "https://registry.npmjs.org/@syncfusion/ej2-navigations/-/ej2-navigations-29.2.8.tgz",
"integrity": "sha512-u14J+dEocqGIKgWCC1eiATv1nh40dgILsGPpGbYS+h9Y7y4YMBRzL2UCcuNHXgPKL7SiJ5lCaVORFco8cxyh6A==",
"dependencies": {
"@syncfusion/ej2-base": "~29.2.4",
"@syncfusion/ej2-buttons": "~29.2.5",
"@syncfusion/ej2-data": "~29.2.4",
"@syncfusion/ej2-inputs": "~29.2.5",
"@syncfusion/ej2-lists": "~29.2.4",
"@syncfusion/ej2-popups": "~29.2.7"
"@syncfusion/ej2-popups": "~29.2.8"
}
},
"node_modules/@syncfusion/ej2-notifications": {
......@@ -4202,9 +4213,9 @@
}
},
"node_modules/@syncfusion/ej2-popups": {
"version": "29.2.7",
"resolved": "https://registry.npmjs.org/@syncfusion/ej2-popups/-/ej2-popups-29.2.7.tgz",
"integrity": "sha512-kDRyqyPwRZjD8Mze3m+4dIaFAorH83jFO4UOD3p5w6VMCYLpi7lmncH3sCHgP/7zD1PsVfzy5iilBvC5mo8Vmw==",
"version": "29.2.8",
"resolved": "https://registry.npmjs.org/@syncfusion/ej2-popups/-/ej2-popups-29.2.8.tgz",
"integrity": "sha512-LsXfTiFd6dyoE8XIxFOgC24TeQCqgLdjp3VOg0tWvyuWiZ/skH2sBlF2Y1CWqNJS07OKhtcjLY1h446RTBlalQ==",
"dependencies": {
"@syncfusion/ej2-base": "~29.2.4",
"@syncfusion/ej2-buttons": "~29.2.5"
......
......@@ -40,6 +40,7 @@
"@syncfusion/ej2-dropdowns": "^29.2.4",
"@syncfusion/ej2-grids": "^29.2.4",
"@syncfusion/ej2-inputs": "^29.2.4",
"@syncfusion/ej2-angular-charts": "^29.2.4",
"@types/quill": "1.3.6",
"angular-calendar": "^0.28.16",
"angular-datatables": "^11.1.1",
......
......@@ -99,7 +99,7 @@ import { OpenImageComponent } from './open-image/open-image.component';
import { ListWidgetsComponent } from './list-widgets/list-widgets.component';
import { ViewListWidgetsComponent } from './view-list-widgets/view-list-widgets.component';
import { GridModule } from '@syncfusion/ej2-angular-grids';
import { PivotViewModule } from '@syncfusion/ej2-angular-pivotview';
import { CalculatedFieldService, ConditionalFormattingService, DrillThroughService, FieldListService, GroupingBarService, NumberFormattingService, PivotFieldListModule, PivotViewModule, ToolbarService, VirtualScrollService } from '@syncfusion/ej2-angular-pivotview';
import { ExcelReportComponent } from './excel-report/excel-report.component';
import { ExcelListComponent } from './excel-list/excel-list.component';
import { ExcelReportToggleComponent } from './excel-report-toggle/excel-report-toggle.component';
......@@ -108,6 +108,14 @@ import { SafeUrlPipe } from 'src/pipe/safe-url.pipe';
import { DatasourceTableComponent } from './datasource-table/datasource-table.component';
import { DatagridSyncfutionComponent } from './datagrid-syncfution/datagrid-syncfution.component';
import { PivotSyncfutionComponent } from './pivot-syncfution/pivot-syncfution.component';
import {
ChartModule,
LineSeriesService,
ColumnSeriesService,
CategoryService,
LegendService,
TooltipService
} from '@syncfusion/ej2-angular-charts';
@NgModule({
imports: [
......@@ -130,7 +138,8 @@ import { PivotSyncfutionComponent } from './pivot-syncfution/pivot-syncfution.co
HttpClientModule,
FeatherModule,
GridModule,
PivotViewModule
PivotViewModule,
PivotFieldListModule,
],
declarations: [
ChatComponent,
......@@ -209,8 +218,20 @@ import { PivotSyncfutionComponent } from './pivot-syncfution/pivot-syncfution.co
ServiceContactrxjsService,
ServiceContactlistRxjsService,
InvoiceService,
ServicejobService
ServicejobService,
FieldListService,
CalculatedFieldService,
ConditionalFormattingService,
NumberFormattingService,
ToolbarService,
GroupingBarService,
DrillThroughService,
VirtualScrollService,
LineSeriesService,
ColumnSeriesService,
CategoryService,
LegendService,
TooltipService
]
})
export class AppsModule { }
<ejs-pivotview #pivotview id='PivotView' [dataSourceSettings]="dataSourceSettings" allowExcelExport='true'
allowNumberFormatting='true' allowConditionalFormatting='true' allowPdfExport='true' showToolbar='true'
allowCalculatedField='true' showFieldList='true' width='100%' [displayOption]='displayOption' height='550'
[toolbar]='toolbarOptions'></ejs-pivotview>
\ No newline at end of file
<ejs-pivotview #pivotview id='PivotView' [dataSourceSettings]="dataSourceSettings" [displayOption]='displayOption'
[toolbar]='toolbarOptions' [allowExcelExport]='true' [allowNumberFormatting]='true'
[allowConditionalFormatting]='true' [allowPdfExport]='true' [showToolbar]='true' [allowCalculatedField]='true'
[showFieldList]='true' width='100%' height='550'></ejs-pivotview>
\ No newline at end of file
......@@ -10,7 +10,8 @@ import {
DisplayOption,
IDataSet,
DataSourceSettings,
PivotViewComponent
PivotViewComponent,
FieldList
} from '@syncfusion/ej2-angular-pivotview';
import { DataSourceSettingsModel } from '@syncfusion/ej2-pivotview/src/model/datasourcesettings-model';
......@@ -49,14 +50,16 @@ export class PivotSyncfutionComponent implements OnInit {
@Output() layout = new EventEmitter<any>();
constructor(private cdr: ChangeDetectorRef) { }
ngOnInit(): void {
}
ngOnChanges(changes: SimpleChanges): void {
if (changes['dataSource']?.currentValue || changes['columns']?.currentValue) {
this.dataSourceSettings = {
dataSource: this.dataSource,
columns: [],
values: this.columns,
rows: this.columns,
columns: this.columns,
values: [],
rows: [],
expandAll: true,
enableSorting: true,
drilledMembers: [],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment