angular-slickgrid 4.2.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist/angular-slickgrid.d.ts → angular-slickgrid.d.ts} +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/components/angular-slickgrid.component.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/constants.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/extensions/index.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/extensions/slickRowDetailView.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/global-grid-options.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/index.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/models/angularComponentOutput.interface.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/models/angularGridInstance.interface.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/models/externalTestingDependencies.interface.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/models/gridOption.interface.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/models/index.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/models/rowDetailView.interface.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/models/slickGrid.interface.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/modules/angular-slickgrid.module.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/services/angularUtil.service.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/services/bsDropdown.service.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/services/container.service.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/services/index.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/services/translater.service.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/services/utilities.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/slickgrid-config.d.ts +0 -0
- package/docs/assets/lib/multiple-select/README.md +17 -0
- package/{dist/esm2020 → esm2020}/angular-slickgrid.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/constants.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/extensions/index.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/extensions/slickRowDetailView.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/global-grid-options.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/index.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/angularComponentOutput.interface.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/angularGridInstance.interface.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/gridOption.interface.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/index.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/rowDetailView.interface.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/slickGrid.interface.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/modules/angular-slickgrid.module.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/angularUtil.service.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/bsDropdown.service.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/container.service.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/index.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/translater.service.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/utilities.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/slickgrid-config.mjs +0 -0
- package/{dist/esm2020 → esm2020}/public_api.mjs +0 -0
- package/{dist/fesm2015 → fesm2015}/angular-slickgrid.mjs +0 -0
- package/{dist/fesm2015 → fesm2015}/angular-slickgrid.mjs.map +0 -0
- package/{dist/fesm2020 → fesm2020}/angular-slickgrid.mjs +0 -0
- package/{dist/fesm2020 → fesm2020}/angular-slickgrid.mjs.map +0 -0
- package/{dist/i18n → i18n}/en.json +0 -0
- package/{dist/i18n → i18n}/fr.json +0 -0
- package/package.json +25 -110
- package/{dist/public_api.d.ts → public_api.d.ts} +0 -0
- package/.browserslistrc +0 -12
- package/.codecov.yml +0 -17
- package/.editorconfig +0 -18
- package/.eslintrc.json +0 -50
- package/.github/CODE_OF_CONDUCT.md +0 -76
- package/.github/FUNDING.yml +0 -8
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -54
- package/.github/ISSUE_TEMPLATE/config.yml +0 -5
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -44
- package/.github/renovate.json5 +0 -26
- package/.github/stale.yml +0 -7
- package/.github/workflows/main.yml +0 -83
- package/.vscode/extensions.json +0 -9
- package/.vscode/launch.json +0 -72
- package/.vscode/settings.json +0 -7
- package/.vscode/tasks.json +0 -77
- package/CHANGELOG.md +0 -1172
- package/angular.json +0 -148
- package/dist/LICENSE +0 -20
- package/dist/README.md +0 -182
- package/dist/package.json +0 -79
- package/global.d.ts +0 -1
- package/ngcc.config.js +0 -13
- package/screenshots/column-picker.png +0 -0
- package/screenshots/composite-editor.png +0 -0
- package/screenshots/draggable-grouping.png +0 -0
- package/screenshots/editors.png +0 -0
- package/screenshots/export-to-file.png +0 -0
- package/screenshots/filter_and_sort.png +0 -0
- package/screenshots/formatters.png +0 -0
- package/screenshots/frozen.png +0 -0
- package/screenshots/multipleSelectFilter.png +0 -0
- package/screenshots/pagination.png +0 -0
- package/screenshots/selectFilter.png +0 -0
- package/screenshots/singleFilter.png +0 -0
- package/src/app/app-routing.module.ts +0 -83
- package/src/app/app.component.html +0 -160
- package/src/app/app.component.scss +0 -65
- package/src/app/app.component.ts +0 -10
- package/src/app/app.module.ts +0 -175
- package/src/app/examples/custom-angularComponentEditor.ts +0 -184
- package/src/app/examples/custom-angularComponentFilter.ts +0 -126
- package/src/app/examples/custom-inputEditor.ts +0 -124
- package/src/app/examples/custom-inputFilter.ts +0 -142
- package/src/app/examples/custom-titleFormatter.component.ts +0 -8
- package/src/app/examples/editor-ng-select.component.ts +0 -37
- package/src/app/examples/filter-ng-select.component.ts +0 -32
- package/src/app/examples/grid-additem.component.html +0 -48
- package/src/app/examples/grid-additem.component.ts +0 -272
- package/src/app/examples/grid-angular.component.html +0 -79
- package/src/app/examples/grid-angular.component.scss +0 -28
- package/src/app/examples/grid-angular.component.ts +0 -370
- package/src/app/examples/grid-autoheight.component.html +0 -52
- package/src/app/examples/grid-autoheight.component.ts +0 -147
- package/src/app/examples/grid-basic.component.html +0 -29
- package/src/app/examples/grid-basic.component.ts +0 -82
- package/src/app/examples/grid-clientside.component.html +0 -51
- package/src/app/examples/grid-clientside.component.ts +0 -293
- package/src/app/examples/grid-colspan.component.html +0 -39
- package/src/app/examples/grid-colspan.component.scss +0 -11
- package/src/app/examples/grid-colspan.component.ts +0 -155
- package/src/app/examples/grid-composite-editor.component.html +0 -79
- package/src/app/examples/grid-composite-editor.component.scss +0 -19
- package/src/app/examples/grid-composite-editor.component.ts +0 -948
- package/src/app/examples/grid-contextmenu.component.html +0 -62
- package/src/app/examples/grid-contextmenu.component.scss +0 -44
- package/src/app/examples/grid-contextmenu.component.ts +0 -473
- package/src/app/examples/grid-custom-tooltip.component.html +0 -25
- package/src/app/examples/grid-custom-tooltip.component.scss +0 -77
- package/src/app/examples/grid-custom-tooltip.component.ts +0 -483
- package/src/app/examples/grid-draggrouping.component.html +0 -93
- package/src/app/examples/grid-draggrouping.component.ts +0 -397
- package/src/app/examples/grid-editor.component.html +0 -88
- package/src/app/examples/grid-editor.component.ts +0 -699
- package/src/app/examples/grid-formatter.component.html +0 -26
- package/src/app/examples/grid-formatter.component.ts +0 -162
- package/src/app/examples/grid-frozen.component.html +0 -65
- package/src/app/examples/grid-frozen.component.scss +0 -11
- package/src/app/examples/grid-frozen.component.ts +0 -303
- package/src/app/examples/grid-graphql-nopage.component.html +0 -33
- package/src/app/examples/grid-graphql-nopage.component.scss +0 -9
- package/src/app/examples/grid-graphql-nopage.component.ts +0 -242
- package/src/app/examples/grid-graphql.component.html +0 -87
- package/src/app/examples/grid-graphql.component.ts +0 -304
- package/src/app/examples/grid-grouping.component.html +0 -80
- package/src/app/examples/grid-grouping.component.ts +0 -313
- package/src/app/examples/grid-headerbutton.component.html +0 -31
- package/src/app/examples/grid-headerbutton.component.scss +0 -10
- package/src/app/examples/grid-headerbutton.component.ts +0 -233
- package/src/app/examples/grid-headermenu.component.html +0 -31
- package/src/app/examples/grid-headermenu.component.scss +0 -25
- package/src/app/examples/grid-headermenu.component.ts +0 -159
- package/src/app/examples/grid-localization.component.html +0 -54
- package/src/app/examples/grid-localization.component.ts +0 -293
- package/src/app/examples/grid-menu.component.html +0 -37
- package/src/app/examples/grid-menu.component.scss +0 -28
- package/src/app/examples/grid-menu.component.ts +0 -229
- package/src/app/examples/grid-odata.component.html +0 -116
- package/src/app/examples/grid-odata.component.ts +0 -441
- package/src/app/examples/grid-range.component.html +0 -74
- package/src/app/examples/grid-range.component.ts +0 -291
- package/src/app/examples/grid-remote.component.html +0 -37
- package/src/app/examples/grid-remote.component.ts +0 -153
- package/src/app/examples/grid-resize-by-content.component.html +0 -62
- package/src/app/examples/grid-resize-by-content.component.scss +0 -19
- package/src/app/examples/grid-resize-by-content.component.ts +0 -780
- package/src/app/examples/grid-rowdetail.component.html +0 -35
- package/src/app/examples/grid-rowdetail.component.ts +0 -205
- package/src/app/examples/grid-rowmove.component.html +0 -49
- package/src/app/examples/grid-rowmove.component.ts +0 -234
- package/src/app/examples/grid-rowselection.component.html +0 -76
- package/src/app/examples/grid-rowselection.component.ts +0 -267
- package/src/app/examples/grid-state.component.html +0 -36
- package/src/app/examples/grid-state.component.ts +0 -259
- package/src/app/examples/grid-tabs.component.html +0 -35
- package/src/app/examples/grid-tabs.component.ts +0 -115
- package/src/app/examples/grid-trading.component.html +0 -58
- package/src/app/examples/grid-trading.component.scss +0 -49
- package/src/app/examples/grid-trading.component.ts +0 -319
- package/src/app/examples/grid-tree-data-hierarchical.component.html +0 -79
- package/src/app/examples/grid-tree-data-hierarchical.component.scss +0 -47
- package/src/app/examples/grid-tree-data-hierarchical.component.ts +0 -311
- package/src/app/examples/grid-tree-data-parent-child.component.html +0 -108
- package/src/app/examples/grid-tree-data-parent-child.component.scss +0 -10
- package/src/app/examples/grid-tree-data-parent-child.component.ts +0 -351
- package/src/app/examples/home.component.html +0 -41
- package/src/app/examples/home.component.ts +0 -9
- package/src/app/examples/rowdetail-preload.component.ts +0 -10
- package/src/app/examples/rowdetail-view.component.html +0 -36
- package/src/app/examples/rowdetail-view.component.ts +0 -54
- package/src/app/examples/swt-common-grid-pagination.component.ts +0 -156
- package/src/app/examples/swt-common-grid-test.component.html +0 -30
- package/src/app/examples/swt-common-grid-test.component.ts +0 -219
- package/src/app/examples/swt-common-grid.component.ts +0 -436
- package/src/app/examples/swt-logger.service.ts +0 -165
- package/src/app/modules/angular-slickgrid/components/angular-slickgrid.component.html +0 -4
- package/src/app/modules/angular-slickgrid/components/angular-slickgrid.component.ts +0 -1395
- package/src/app/modules/angular-slickgrid/constants.ts +0 -97
- package/src/app/modules/angular-slickgrid/extensions/index.ts +0 -1
- package/src/app/modules/angular-slickgrid/extensions/slickRowDetailView.ts +0 -375
- package/src/app/modules/angular-slickgrid/global-grid-options.ts +0 -245
- package/src/app/modules/angular-slickgrid/index.ts +0 -11
- package/src/app/modules/angular-slickgrid/models/angularComponentOutput.interface.ts +0 -6
- package/src/app/modules/angular-slickgrid/models/angularGridInstance.interface.ts +0 -68
- package/src/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.ts +0 -37
- package/src/app/modules/angular-slickgrid/models/gridOption.interface.ts +0 -12
- package/src/app/modules/angular-slickgrid/models/index.ts +0 -6
- package/src/app/modules/angular-slickgrid/models/rowDetailView.interface.ts +0 -33
- package/src/app/modules/angular-slickgrid/models/slickGrid.interface.ts +0 -7
- package/src/app/modules/angular-slickgrid/modules/angular-slickgrid.module.ts +0 -37
- package/src/app/modules/angular-slickgrid/services/angularUtil.service.ts +0 -48
- package/src/app/modules/angular-slickgrid/services/bsDropdown.service.ts +0 -142
- package/src/app/modules/angular-slickgrid/services/container.service.ts +0 -24
- package/src/app/modules/angular-slickgrid/services/index.ts +0 -5
- package/src/app/modules/angular-slickgrid/services/translater.service.ts +0 -38
- package/src/app/modules/angular-slickgrid/services/utilities.ts +0 -19
- package/src/app/modules/angular-slickgrid/slickgrid-config.ts +0 -10
- package/src/app/slickgrid-custom-variables.scss +0 -10
- package/src/assets/.gitkeep +0 -0
- package/src/assets/data/collection_100_numbers.json +0 -12
- package/src/assets/data/collection_500_numbers.json +0 -52
- package/src/assets/data/countries.json +0 -245
- package/src/assets/data/country_names.json +0 -245
- package/src/assets/data/customers_100.json +0 -102
- package/src/assets/i18n/en.json +0 -90
- package/src/assets/i18n/fr.json +0 -91
- package/src/environments/environment.prod.ts +0 -3
- package/src/environments/environment.ts +0 -8
- package/src/favicon.ico +0 -0
- package/src/index.html +0 -18
- package/src/main.ts +0 -13
- package/src/polyfills.ts +0 -52
- package/src/public_api.ts +0 -1
- package/src/styles.scss +0 -66
- package/src/typings.d.ts +0 -10
- package/tsconfig.app.json +0 -25
- package/tsconfig.json +0 -40
- package/tsconfig.spec.json +0 -23
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<div id="demo-container" class="container-fluid">
|
|
2
|
-
<h2>
|
|
3
|
-
{{title}}
|
|
4
|
-
<span class="float-end">
|
|
5
|
-
<a style="font-size: 18px"
|
|
6
|
-
target="_blank"
|
|
7
|
-
href="https://github.com/ghiscoding/Angular-Slickgrid/blob/master/src/app/examples/grid-clientside.component.ts">
|
|
8
|
-
<span class="fa fa-link"></span> code
|
|
9
|
-
</a>
|
|
10
|
-
</span>
|
|
11
|
-
</h2>
|
|
12
|
-
<div class="subtitle" [innerHTML]="subTitle"></div>
|
|
13
|
-
|
|
14
|
-
<br />
|
|
15
|
-
<span *ngIf="metrics" style="margin-right: 10px">
|
|
16
|
-
<b>Metrics:</b> {{metrics.startTime | date: 'yyyy-MM-dd hh:mm aaaaa\'m\''}} | {{metrics.itemCount}} of
|
|
17
|
-
{{metrics.totalItemCount}} items
|
|
18
|
-
</span>
|
|
19
|
-
<div class="btn-group" role="group">
|
|
20
|
-
<button class="btn btn-sm btn-outline-secondary" data-test="scroll-top-btn" (click)="scrollGridTop()">
|
|
21
|
-
<i class="fa fa-arrow-up"></i>
|
|
22
|
-
</button>
|
|
23
|
-
<button class="btn btn-sm btn-outline-secondary" data-test="scroll-bottom-btn" (click)="scrollGridBottom()">
|
|
24
|
-
<i class="fa fa-arrow-down"></i>
|
|
25
|
-
</button>
|
|
26
|
-
</div>
|
|
27
|
-
<button class="btn btn-outline-secondary btn-sm" data-test="clear-filters"
|
|
28
|
-
(click)="angularGrid.filterService.clearFilters()">
|
|
29
|
-
Clear Filters
|
|
30
|
-
</button>
|
|
31
|
-
<button class="btn btn-outline-secondary btn-sm" data-test="clear-sorting"
|
|
32
|
-
(click)="angularGrid.sortService.clearSorting()">
|
|
33
|
-
Clear Sorting
|
|
34
|
-
</button>
|
|
35
|
-
<button class="btn btn-outline-secondary btn-sm" data-test="set-dynamic-filter" (click)="setFiltersDynamically()">
|
|
36
|
-
Set Filters Dynamically
|
|
37
|
-
</button>
|
|
38
|
-
<button class="btn btn-outline-secondary btn-sm" data-test="set-dynamic-sorting" (click)="setSortingDynamically()">
|
|
39
|
-
Set Sorting Dynamically
|
|
40
|
-
</button>
|
|
41
|
-
|
|
42
|
-
<angular-slickgrid gridId="grid4"
|
|
43
|
-
[columnDefinitions]="columnDefinitions"
|
|
44
|
-
[gridOptions]="gridOptions"
|
|
45
|
-
[dataset]="dataset"
|
|
46
|
-
(onAngularGridCreated)="angularGridReady($event.detail)"
|
|
47
|
-
(onGridStateChanged)="gridStateChanged($event.detail)"
|
|
48
|
-
(onBeforeGridDestroy)="saveCurrentGridState()"
|
|
49
|
-
(onRowCountChanged)="refreshMetrics($event.detail.eventData, $event.detail.args)">
|
|
50
|
-
</angular-slickgrid>
|
|
51
|
-
</div>
|
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
import { Component, OnInit } from '@angular/core';
|
|
2
|
-
import { HttpClient } from '@angular/common/http';
|
|
3
|
-
import { ExcelExportService } from '@slickgrid-universal/excel-export';
|
|
4
|
-
import { TranslateService } from '@ngx-translate/core';
|
|
5
|
-
import {
|
|
6
|
-
AngularGridInstance,
|
|
7
|
-
Column,
|
|
8
|
-
FieldType,
|
|
9
|
-
Filters,
|
|
10
|
-
FlatpickrOption,
|
|
11
|
-
Formatters,
|
|
12
|
-
GridOption,
|
|
13
|
-
GridStateChange,
|
|
14
|
-
Metrics,
|
|
15
|
-
MultipleSelectOption,
|
|
16
|
-
OperatorType,
|
|
17
|
-
} from './../modules/angular-slickgrid';
|
|
18
|
-
import { CustomInputFilter } from './custom-inputFilter';
|
|
19
|
-
|
|
20
|
-
function randomBetween(min: number, max: number) {
|
|
21
|
-
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
22
|
-
}
|
|
23
|
-
const NB_ITEMS = 1500;
|
|
24
|
-
const URL_SAMPLE_COLLECTION_DATA = 'assets/data/collection_500_numbers.json';
|
|
25
|
-
|
|
26
|
-
@Component({
|
|
27
|
-
templateUrl: './grid-clientside.component.html'
|
|
28
|
-
})
|
|
29
|
-
export class GridClientSideComponent implements OnInit {
|
|
30
|
-
title = 'Example 4: Client Side Sort/Filter';
|
|
31
|
-
subTitle = `
|
|
32
|
-
Sort/Filter on client side only using SlickGrid DataView (<a href="https://github.com/ghiscoding/Angular-Slickgrid/wiki/Sorting" target="_blank">Wiki docs</a>)
|
|
33
|
-
<br/>
|
|
34
|
-
<ul class="small">
|
|
35
|
-
<li>Support multi-sort (by default), hold "Shift" key and click on the next column to sort.</li>
|
|
36
|
-
<li>All column types support the following operators: (>, >=, <, <=, <>, !=, =, ==, *)</li>
|
|
37
|
-
<ul>
|
|
38
|
-
<li>Example: >100 ... >=2001-01-01 ... >02/28/17</li>
|
|
39
|
-
<li><b>Note:</b> For filters to work properly (default is string), make sure to provide a FieldType (type is against the dataset, not the Formatter)</li>
|
|
40
|
-
</ul>
|
|
41
|
-
<li>Date Filters</li>
|
|
42
|
-
<ul>
|
|
43
|
-
<li>
|
|
44
|
-
FieldType of dateUtc/date (from dataset) can use an extra option of "filterSearchType" to let user filter more easily.
|
|
45
|
-
For example, in the "UTC Date" field below, you can type ">02/28/2017", also when dealing with UTC you have to take the time difference in consideration.
|
|
46
|
-
</li>
|
|
47
|
-
</ul>
|
|
48
|
-
<li>On String filters, (*) can be used as startsWith (Hello* => matches "Hello Word") ... endsWith (*Doe => matches: "John Doe")</li>
|
|
49
|
-
<li>Custom Filter are now possible, "Description" column below, is a customized InputFilter with different placeholder. See <a href="https://github.com/ghiscoding/Angular-Slickgrid/wiki/Custom-Filter" target="_blank">Wiki - Custom Filter</a>
|
|
50
|
-
<li>MultipleSelect & SingeSelect Filters can use a regular "collection" or "collectionAsync" to load it asynchronously</li>
|
|
51
|
-
</ul>
|
|
52
|
-
`;
|
|
53
|
-
|
|
54
|
-
angularGrid!: AngularGridInstance;
|
|
55
|
-
columnDefinitions: Column[] = [];
|
|
56
|
-
gridOptions!: GridOption;
|
|
57
|
-
dataset!: any[];
|
|
58
|
-
metrics!: Metrics;
|
|
59
|
-
|
|
60
|
-
constructor(private http: HttpClient, private translate: TranslateService) { }
|
|
61
|
-
|
|
62
|
-
ngOnInit(): void {
|
|
63
|
-
this.columnDefinitions = [
|
|
64
|
-
{
|
|
65
|
-
id: 'title', name: 'Title', field: 'title', sortable: true, minWidth: 55,
|
|
66
|
-
type: FieldType.string, filterable: true, filter: { model: Filters.compoundInputText }
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
id: 'description', name: 'Description', field: 'description', filterable: true, sortable: true, minWidth: 80,
|
|
70
|
-
type: FieldType.string,
|
|
71
|
-
filter: {
|
|
72
|
-
model: new CustomInputFilter(), // create a new instance to make each Filter independent from each other
|
|
73
|
-
enableTrimWhiteSpace: true // or use global "enableFilterTrimWhiteSpace" to trim on all Filters
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
id: 'duration', name: 'Duration (days)', field: 'duration', sortable: true, type: FieldType.number, exportCsvForceToKeepAsString: true,
|
|
78
|
-
minWidth: 55,
|
|
79
|
-
filterable: true,
|
|
80
|
-
filter: {
|
|
81
|
-
collectionAsync: this.http.get<{ option: string; value: string; }[]>(URL_SAMPLE_COLLECTION_DATA),
|
|
82
|
-
// collectionFilterBy & collectionSortBy accept a single or multiple options
|
|
83
|
-
// we can exclude certains values 365 & 360 from the dropdown filter
|
|
84
|
-
collectionFilterBy: [{
|
|
85
|
-
property: 'value',
|
|
86
|
-
operator: OperatorType.notEqual,
|
|
87
|
-
value: 360
|
|
88
|
-
}, {
|
|
89
|
-
property: 'value',
|
|
90
|
-
operator: OperatorType.notEqual,
|
|
91
|
-
value: 365
|
|
92
|
-
}],
|
|
93
|
-
collectionSortBy: {
|
|
94
|
-
property: 'value',
|
|
95
|
-
sortDesc: true,
|
|
96
|
-
fieldType: FieldType.number
|
|
97
|
-
},
|
|
98
|
-
customStructure: {
|
|
99
|
-
value: 'value',
|
|
100
|
-
label: 'label',
|
|
101
|
-
optionLabel: 'value', // if selected text is too long, we can use option labels instead
|
|
102
|
-
labelSuffix: 'text',
|
|
103
|
-
},
|
|
104
|
-
collectionOptions: {
|
|
105
|
-
separatorBetweenTextLabels: ' ',
|
|
106
|
-
filterResultAfterEachPass: 'chain' // options are "merge" or "chain" (defaults to "chain")
|
|
107
|
-
},
|
|
108
|
-
model: Filters.multipleSelect,
|
|
109
|
-
|
|
110
|
-
// we could add certain option(s) to the "multiple-select" plugin
|
|
111
|
-
filterOptions: {
|
|
112
|
-
maxHeight: 250,
|
|
113
|
-
width: 175,
|
|
114
|
-
|
|
115
|
-
// if we want to display shorter text as the selected text (on the select filter itself, parent element)
|
|
116
|
-
// we can use "useSelectOptionLabel" or "useSelectOptionLabelToHtml" the latter will parse html
|
|
117
|
-
useSelectOptionLabelToHtml: true
|
|
118
|
-
} as MultipleSelectOption
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
id: 'complete', name: '% Complete', field: 'percentComplete', formatter: Formatters.percentCompleteBar, minWidth: 70, type: FieldType.number, sortable: true,
|
|
123
|
-
filterable: true, filter: { model: Filters.compoundInputNumber }
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
id: 'start', name: 'Start', field: 'start', formatter: Formatters.dateIso, sortable: true, minWidth: 75, exportWithFormatter: false,
|
|
127
|
-
type: FieldType.date, filterable: true, filter: { model: Filters.compoundDate }
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
id: 'usDateShort', name: 'US Date Short', field: 'usDateShort', sortable: true, minWidth: 70, width: 70,
|
|
131
|
-
type: FieldType.dateUsShort, exportWithFormatter: true, filterable: true, filter: { model: Filters.compoundDate }
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
id: 'utcDate', name: 'UTC Date', field: 'utcDate', formatter: Formatters.dateTimeIsoAmPm, sortable: true, minWidth: 115,
|
|
135
|
-
type: FieldType.dateUtc, exportWithFormatter: true, outputType: FieldType.dateTimeIsoAmPm, filterable: true,
|
|
136
|
-
filter: {
|
|
137
|
-
model: Filters.compoundDate,
|
|
138
|
-
// override any of the Flatpickr options through "filterOptions"
|
|
139
|
-
// please note that there's no TSlint on this property since it's generic for any filter, so make sure you entered the correct filter option(s)
|
|
140
|
-
filterOptions: { minDate: 'today' } as FlatpickrOption
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven.isEffort', minWidth: 85, maxWidth: 85,
|
|
145
|
-
type: FieldType.boolean,
|
|
146
|
-
sortable: true,
|
|
147
|
-
exportCustomFormatter: Formatters.complexObject,
|
|
148
|
-
|
|
149
|
-
// to pass multiple formatters, use the params property
|
|
150
|
-
// also these formatters are executed in sequence, so if you want the checkmark to work correctly, it has to be the last formatter defined
|
|
151
|
-
formatter: Formatters.multiple,
|
|
152
|
-
params: { formatters: [Formatters.complexObject, Formatters.checkmark] },
|
|
153
|
-
|
|
154
|
-
// when the "field" string includes the dot "." notation, the library will consider this to be a complex object and Filter accordingly
|
|
155
|
-
filterable: true,
|
|
156
|
-
filter: {
|
|
157
|
-
// We can also add HTML text to be rendered (any bad script will be sanitized) but we have to opt-in, else it will be sanitized
|
|
158
|
-
// enableRenderHtml: true,
|
|
159
|
-
// collection: [{ value: '', label: '' }, { value: true, label: 'True', labelPrefix: `<i class="fa fa-check"></i> ` }, { value: false, label: 'False' }],
|
|
160
|
-
|
|
161
|
-
collection: [{ isEffort: '', label: '' }, { isEffort: true, label: 'True' }, { isEffort: false, label: 'False' }],
|
|
162
|
-
customStructure: {
|
|
163
|
-
value: 'isEffort',
|
|
164
|
-
label: 'label'
|
|
165
|
-
},
|
|
166
|
-
model: Filters.singleSelect,
|
|
167
|
-
|
|
168
|
-
// we could add certain option(s) to the "multiple-select" plugin
|
|
169
|
-
filterOptions: { autoDropWidth: true } as MultipleSelectOption,
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
];
|
|
173
|
-
|
|
174
|
-
this.gridOptions = {
|
|
175
|
-
autoResize: {
|
|
176
|
-
container: '#demo-container',
|
|
177
|
-
rightPadding: 10
|
|
178
|
-
},
|
|
179
|
-
enableExcelExport: true,
|
|
180
|
-
enableExcelCopyBuffer: true,
|
|
181
|
-
enableFiltering: true,
|
|
182
|
-
// enableFilterTrimWhiteSpace: true,
|
|
183
|
-
i18n: this.translate,
|
|
184
|
-
showCustomFooter: true, // display some metrics in the bottom custom footer
|
|
185
|
-
|
|
186
|
-
// use columnDef searchTerms OR use presets as shown below
|
|
187
|
-
presets: {
|
|
188
|
-
filters: [
|
|
189
|
-
{ columnId: 'duration', searchTerms: [10, 98] },
|
|
190
|
-
// { columnId: 'complete', searchTerms: ['5'], operator: '>' },
|
|
191
|
-
{ columnId: 'usDateShort', operator: '<', searchTerms: ['4/20/25'] },
|
|
192
|
-
// { columnId: 'effort-driven', searchTerms: [true] },
|
|
193
|
-
],
|
|
194
|
-
sorters: [
|
|
195
|
-
{ columnId: 'duration', direction: 'DESC' },
|
|
196
|
-
{ columnId: 'complete', direction: 'ASC' }
|
|
197
|
-
],
|
|
198
|
-
},
|
|
199
|
-
registerExternalResources: [new ExcelExportService()],
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
// mock a dataset
|
|
203
|
-
this.dataset = this.mockData(NB_ITEMS);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
207
|
-
this.angularGrid = angularGrid;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
mockData(itemCount: number, startingIndex = 0): any[] {
|
|
211
|
-
// mock a dataset
|
|
212
|
-
const tempDataset = [];
|
|
213
|
-
for (let i = startingIndex; i < (startingIndex + itemCount); i++) {
|
|
214
|
-
const randomDuration = Math.round(Math.random() * 100);
|
|
215
|
-
const randomYear = randomBetween(2000, 2035);
|
|
216
|
-
const randomYearShort = randomBetween(10, 35);
|
|
217
|
-
const randomMonth = randomBetween(1, 12);
|
|
218
|
-
const randomMonthStr = (randomMonth < 10) ? `0${randomMonth}` : randomMonth;
|
|
219
|
-
const randomDay = randomBetween(10, 28);
|
|
220
|
-
const randomPercent = randomBetween(0, 100);
|
|
221
|
-
const randomHour = randomBetween(10, 23);
|
|
222
|
-
const randomTime = randomBetween(10, 59);
|
|
223
|
-
const randomMilliseconds = `${randomBetween(1, 9)}${randomBetween(10, 99)}`;
|
|
224
|
-
const randomIsEffort = (i % 3 === 0);
|
|
225
|
-
|
|
226
|
-
tempDataset.push({
|
|
227
|
-
id: i,
|
|
228
|
-
title: 'Task ' + i,
|
|
229
|
-
description: (i % 5) ? 'desc ' + i : null, // also add some random to test NULL field
|
|
230
|
-
duration: randomDuration,
|
|
231
|
-
percentComplete: randomPercent,
|
|
232
|
-
percentCompleteNumber: randomPercent,
|
|
233
|
-
start: (i % 4) ? null : new Date(randomYear, randomMonth, randomDay), // provide a Date format
|
|
234
|
-
usDateShort: `${randomMonth}/${randomDay}/${randomYearShort}`, // provide a date US Short in the dataset
|
|
235
|
-
utcDate: `${randomYear}-${randomMonthStr}-${randomDay}T${randomHour}:${randomTime}:${randomTime}.${randomMilliseconds}Z`,
|
|
236
|
-
effortDriven: {
|
|
237
|
-
isEffort: randomIsEffort,
|
|
238
|
-
label: randomIsEffort ? 'Effort' : 'NoEffort',
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
return tempDataset;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/** Dispatched event of a Grid State Changed event */
|
|
246
|
-
gridStateChanged(gridState: GridStateChange) {
|
|
247
|
-
console.log('Client sample, Grid State changed:: ', gridState);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
/** Save current Filters, Sorters in LocaleStorage or DB */
|
|
251
|
-
saveCurrentGridState() {
|
|
252
|
-
console.log('Client sample, last Grid State:: ', this.angularGrid.gridStateService.getCurrentGridState());
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
setFiltersDynamically() {
|
|
256
|
-
// we can Set Filters Dynamically (or different filters) afterward through the FilterService
|
|
257
|
-
this.angularGrid.filterService.updateFilters([
|
|
258
|
-
{ columnId: 'duration', searchTerms: [2, 25, 48, 50] },
|
|
259
|
-
{ columnId: 'complete', searchTerms: [95], operator: '<' },
|
|
260
|
-
{ columnId: 'effort-driven', searchTerms: [true] },
|
|
261
|
-
{ columnId: 'start', operator: '>=', searchTerms: ['2001-02-28'] },
|
|
262
|
-
]);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
setSortingDynamically() {
|
|
266
|
-
this.angularGrid.sortService.updateSorting([
|
|
267
|
-
// orders matter, whichever is first in array will be the first sorted column
|
|
268
|
-
{ columnId: 'duration', direction: 'ASC' },
|
|
269
|
-
{ columnId: 'start', direction: 'DESC' },
|
|
270
|
-
]);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
refreshMetrics(e: Event, args: any) {
|
|
274
|
-
if (args && args.current >= 0) {
|
|
275
|
-
setTimeout(() => {
|
|
276
|
-
this.metrics = {
|
|
277
|
-
startTime: new Date(),
|
|
278
|
-
endTime: new Date(),
|
|
279
|
-
itemCount: args && args.current || 0,
|
|
280
|
-
totalItemCount: this.dataset.length || 0
|
|
281
|
-
};
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
scrollGridBottom() {
|
|
287
|
-
this.angularGrid.slickGrid.navigateBottom();
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
scrollGridTop() {
|
|
291
|
-
this.angularGrid.slickGrid.navigateTop();
|
|
292
|
-
}
|
|
293
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<div id="demo-container" class="container-fluid">
|
|
2
|
-
<h2>
|
|
3
|
-
{{title}}
|
|
4
|
-
<span class="float-end">
|
|
5
|
-
<a style="font-size: 18px"
|
|
6
|
-
target="_blank"
|
|
7
|
-
href="https://github.com/ghiscoding/Angular-Slickgrid/blob/master/src/app/examples/grid-colspan.component.ts">
|
|
8
|
-
<span class="fa fa-link"></span> code
|
|
9
|
-
</a>
|
|
10
|
-
</span>
|
|
11
|
-
</h2>
|
|
12
|
-
<div class="subtitle" [innerHTML]="subTitle"></div>
|
|
13
|
-
|
|
14
|
-
<h3>Grid 1 <small>(with Header Grouping & Colspan)</small></h3>
|
|
15
|
-
<angular-slickgrid gridId="grid1"
|
|
16
|
-
[columnDefinitions]="columnDefinitions1"
|
|
17
|
-
[gridOptions]="gridOptions1"
|
|
18
|
-
[dataset]="dataset1">
|
|
19
|
-
</angular-slickgrid>
|
|
20
|
-
|
|
21
|
-
<hr />
|
|
22
|
-
|
|
23
|
-
<h3>Grid 2 <small>(with Header Grouping & Frozen/Pinned Columns)</small></h3>
|
|
24
|
-
<div class="col-sm 12">
|
|
25
|
-
<button class="btn btn-outline-secondary btn-sm" (click)="setFrozenColumns2(-1)"
|
|
26
|
-
data-test="remove-frozen-column-button">
|
|
27
|
-
<i class="fa fa-times fa-lg"></i> Remove Frozen Columns
|
|
28
|
-
</button>
|
|
29
|
-
<button class="btn btn-outline-secondary btn-sm" (click)="setFrozenColumns2(2)" data-test="set-3frozen-columns">
|
|
30
|
-
<i class="fa fa-thumb-tack fa-lg"></i> Set 3 Frozen Columns
|
|
31
|
-
</button>
|
|
32
|
-
</div>
|
|
33
|
-
<angular-slickgrid gridId="grid2"
|
|
34
|
-
[columnDefinitions]="columnDefinitions2"
|
|
35
|
-
[gridOptions]="gridOptions2"
|
|
36
|
-
[dataset]="dataset2"
|
|
37
|
-
(onAngularGridCreated)="angularGridReady2($event.detail)">
|
|
38
|
-
</angular-slickgrid>
|
|
39
|
-
</div>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** You can change the pinned/frozen border styling through this css override */
|
|
2
|
-
|
|
3
|
-
.slick-row .slick-cell.frozen:last-child,
|
|
4
|
-
.slick-headerrow-column.frozen:last-child,
|
|
5
|
-
.slick-footerrow-column.frozen:last-child {
|
|
6
|
-
border-right: 1px solid #969696 !important;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.slick-pane-bottom {
|
|
10
|
-
border-top: 1px solid #969696 !important;
|
|
11
|
-
}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { Component, OnInit } from '@angular/core';
|
|
2
|
-
import { ExcelExportService } from '@slickgrid-universal/excel-export';
|
|
3
|
-
|
|
4
|
-
import { AngularGridInstance, Column, FieldType, GridOption, ItemMetadata } from './../modules/angular-slickgrid';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
templateUrl: './grid-colspan.component.html',
|
|
8
|
-
styleUrls: ['./grid-colspan.component.scss'],
|
|
9
|
-
})
|
|
10
|
-
export class GridColspanComponent implements OnInit {
|
|
11
|
-
title = 'Example 15: Column Span & Header Grouping';
|
|
12
|
-
subTitle = `
|
|
13
|
-
This example demonstrates how to easily span a row over multiple columns & how to group header titles.
|
|
14
|
-
<ul>
|
|
15
|
-
<li>
|
|
16
|
-
Row Colspan - (<a href="https://github.com/ghiscoding/Angular-Slickgrid/wiki/Row-Colspan" target="_blank">Wiki docs</a>) /
|
|
17
|
-
Header Grouping - (<a href="https://github.com/ghiscoding/Angular-Slickgrid/wiki/Header-Title-Grouping" target="_blank">Wiki docs</a>)
|
|
18
|
-
</li>
|
|
19
|
-
<li>Note that you can add Sort but remember that it will sort by the data which the row contains, even if the data is visually hidden by colspan it will still sort it</li>
|
|
20
|
-
<li>
|
|
21
|
-
Header Grouping spanning accross multiple columns is working but has some UI issues on window resize.
|
|
22
|
-
If anyone can fix it, probably some CSS issues, please let us know.
|
|
23
|
-
</li>
|
|
24
|
-
</ul>
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
angularGrid2!: AngularGridInstance;
|
|
28
|
-
gridObj2: any;
|
|
29
|
-
columnDefinitions1!: Column[];
|
|
30
|
-
columnDefinitions2!: Column[];
|
|
31
|
-
gridOptions1!: GridOption;
|
|
32
|
-
gridOptions2!: GridOption;
|
|
33
|
-
dataset1: any[] = [];
|
|
34
|
-
dataset2: any[] = [];
|
|
35
|
-
|
|
36
|
-
ngOnInit(): void {
|
|
37
|
-
this.prepareGrid1();
|
|
38
|
-
this.prepareGrid2();
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
angularGridReady2(angularGrid: AngularGridInstance) {
|
|
42
|
-
this.angularGrid2 = angularGrid;
|
|
43
|
-
this.gridObj2 = angularGrid.slickGrid;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
prepareGrid1() {
|
|
47
|
-
this.columnDefinitions1 = [
|
|
48
|
-
{ id: 'title', name: 'Title', field: 'title', sortable: true, columnGroup: 'Common Factor' },
|
|
49
|
-
{ id: 'duration', name: 'Duration', field: 'duration', columnGroup: 'Common Factor' },
|
|
50
|
-
{ id: 'start', name: 'Start', field: 'start', columnGroup: 'Period' },
|
|
51
|
-
{ id: 'finish', name: 'Finish', field: 'finish', columnGroup: 'Period' },
|
|
52
|
-
{ id: '%', name: '% Complete', field: 'percentComplete', selectable: false, columnGroup: 'Analysis' },
|
|
53
|
-
{ id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', type: FieldType.boolean, columnGroup: 'Analysis' }
|
|
54
|
-
];
|
|
55
|
-
|
|
56
|
-
this.gridOptions1 = {
|
|
57
|
-
gridHeight: 275,
|
|
58
|
-
gridWidth: 800,
|
|
59
|
-
enableAutoResize: false,
|
|
60
|
-
enableCellNavigation: true,
|
|
61
|
-
enableSorting: true,
|
|
62
|
-
createPreHeaderPanel: true,
|
|
63
|
-
showPreHeaderPanel: true,
|
|
64
|
-
preHeaderPanelHeight: 28,
|
|
65
|
-
explicitInitialization: true,
|
|
66
|
-
colspanCallback: this.renderDifferentColspan,
|
|
67
|
-
enableExcelExport: true,
|
|
68
|
-
excelExportOptions: {
|
|
69
|
-
exportWithFormatter: false
|
|
70
|
-
},
|
|
71
|
-
registerExternalResources: [new ExcelExportService()],
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
this.dataset1 = this.getData(500);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
prepareGrid2() {
|
|
78
|
-
this.columnDefinitions2 = [
|
|
79
|
-
{ id: 'sel', name: '#', field: 'num', behavior: 'select', cssClass: 'cell-selection', width: 40, resizable: false, selectable: false },
|
|
80
|
-
{ id: 'title', name: 'Title', field: 'title', sortable: true, columnGroup: 'Common Factor' },
|
|
81
|
-
{ id: 'duration', name: 'Duration', field: 'duration', columnGroup: 'Common Factor' },
|
|
82
|
-
{ id: 'start', name: 'Start', field: 'start', columnGroup: 'Period' },
|
|
83
|
-
{ id: 'finish', name: 'Finish', field: 'finish', columnGroup: 'Period' },
|
|
84
|
-
{ id: '%', name: '% Complete', field: 'percentComplete', selectable: false, columnGroup: 'Analysis' },
|
|
85
|
-
{ id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', type: FieldType.boolean, columnGroup: 'Analysis' }
|
|
86
|
-
];
|
|
87
|
-
|
|
88
|
-
this.gridOptions2 = {
|
|
89
|
-
gridHeight: 275,
|
|
90
|
-
gridWidth: 800,
|
|
91
|
-
enableCellNavigation: true,
|
|
92
|
-
createPreHeaderPanel: true,
|
|
93
|
-
showPreHeaderPanel: true,
|
|
94
|
-
preHeaderPanelHeight: 25,
|
|
95
|
-
explicitInitialization: true,
|
|
96
|
-
frozenColumn: 2,
|
|
97
|
-
gridMenu: { hideClearFrozenColumnsCommand: false },
|
|
98
|
-
headerMenu: { hideFreezeColumnsCommand: false },
|
|
99
|
-
enableExcelExport: true,
|
|
100
|
-
excelExportOptions: {
|
|
101
|
-
exportWithFormatter: false
|
|
102
|
-
},
|
|
103
|
-
registerExternalResources: [new ExcelExportService()],
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
this.dataset2 = this.getData(500);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
getData(count: number) {
|
|
110
|
-
// Set up some test columns.
|
|
111
|
-
const mockDataset = [];
|
|
112
|
-
for (let i = 0; i < count; i++) {
|
|
113
|
-
mockDataset[i] = {
|
|
114
|
-
id: i,
|
|
115
|
-
num: i,
|
|
116
|
-
title: 'Task ' + i,
|
|
117
|
-
duration: '5 days',
|
|
118
|
-
percentComplete: Math.round(Math.random() * 100),
|
|
119
|
-
start: '01/01/2009',
|
|
120
|
-
finish: '01/05/2009',
|
|
121
|
-
effortDriven: (i % 5 === 0)
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
return mockDataset;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
setFrozenColumns2(frozenCols: number) {
|
|
128
|
-
this.gridObj2.setOptions({ frozenColumn: frozenCols });
|
|
129
|
-
this.gridOptions2 = this.gridObj2.getOptions();
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* A callback to render different row column span
|
|
134
|
-
* Your callback will always have the "item" argument which you can use to decide on the colspan
|
|
135
|
-
* Your return must always be in the form of:: return { columns: {}}
|
|
136
|
-
*/
|
|
137
|
-
renderDifferentColspan(item: any): ItemMetadata {
|
|
138
|
-
if (item.id % 2 === 1) {
|
|
139
|
-
return {
|
|
140
|
-
columns: {
|
|
141
|
-
duration: {
|
|
142
|
-
colspan: 3 // "duration" will span over 3 columns
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
return {
|
|
148
|
-
columns: {
|
|
149
|
-
0: {
|
|
150
|
-
colspan: '*' // starting at column index 0, we will span accross all column (*)
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<div id="demo-container" class="container-fluid">
|
|
2
|
-
<h2>
|
|
3
|
-
{{title}}
|
|
4
|
-
<span class="float-end">
|
|
5
|
-
<a style="font-size: 18px"
|
|
6
|
-
target="_blank"
|
|
7
|
-
href="https://github.com/ghiscoding/Angular-Slickgrid/blob/master/src/app/examples/grid-composite-editor.component.ts">
|
|
8
|
-
<span class="fa fa-link"></span> code
|
|
9
|
-
</a>
|
|
10
|
-
</span>
|
|
11
|
-
</h2>
|
|
12
|
-
<div class="subtitle" [innerHTML]="subTitle"></div>
|
|
13
|
-
|
|
14
|
-
<div class="mb-2">
|
|
15
|
-
<div class="btn-group btn-group-sm" role="group" aria-label="Basic Editing Commands">
|
|
16
|
-
<button type="button" class="btn btn-outline-secondary" data-test="toggle-readonly-btn"
|
|
17
|
-
(click)="toggleGridEditReadonly()">
|
|
18
|
-
<i class="fa fa-table"></i> Toggle Edit/Readonly Grid
|
|
19
|
-
</button>
|
|
20
|
-
<button type="button" class="btn btn-outline-secondary" data-test="undo-last-edit-btn"
|
|
21
|
-
(click)="undoLastEdit()">
|
|
22
|
-
<i class="fa fa-undo"></i> Undo Last Edit
|
|
23
|
-
</button>
|
|
24
|
-
<button type="button" class="btn btn-outline-secondary" data-test="undo-open-editor-btn"
|
|
25
|
-
(click)="undoLastEdit(true)">
|
|
26
|
-
<i class="fa fa-undo"></i> Undo Last Edit & Open Editor
|
|
27
|
-
</button>
|
|
28
|
-
<button type="button" class="btn btn-outline-secondary" data-test="undo-all-edits-btn"
|
|
29
|
-
(click)="undoAllEdits()">
|
|
30
|
-
<i class="fa fa-history"></i> Undo All Edits
|
|
31
|
-
</button>
|
|
32
|
-
<button type="button" class="btn btn-outline-secondary" data-test="save-all-btn"
|
|
33
|
-
(click)="saveAll()">
|
|
34
|
-
<i class="fa fa-save"></i> Save All
|
|
35
|
-
</button>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<div class="mb-3">
|
|
40
|
-
<div class="btn-group btn-group-sm" role="group" aria-label="Basic example">
|
|
41
|
-
<button type="button" class="btn btn-outline-secondary" data-test="open-modal-create-btn"
|
|
42
|
-
(click)="openCompositeModal('create')" [disabled]="isCompositeDisabled">
|
|
43
|
-
<i class="fa fa-plus"></i> Item Create
|
|
44
|
-
</button>
|
|
45
|
-
<button type="button" class="btn btn-outline-secondary" data-test="open-modal-clone-btn"
|
|
46
|
-
(click)="openCompositeModal('clone')" [disabled]="isCompositeDisabled">
|
|
47
|
-
<i class="fa fa-clone"></i> Item Clone
|
|
48
|
-
</button>
|
|
49
|
-
<button type="button" class="btn btn-outline-secondary" data-test="open-modal-edit-btn"
|
|
50
|
-
(click)="openCompositeModal('edit')" [disabled]="isCompositeDisabled">
|
|
51
|
-
<i class="fa fa-pencil"></i> Item Edit
|
|
52
|
-
</button>
|
|
53
|
-
<button type="button" class="btn btn-outline-secondary" data-test="open-modal-mass-update-btn"
|
|
54
|
-
(click)="openCompositeModal('mass-update')" [disabled]="isCompositeDisabled">
|
|
55
|
-
<i class="fa fa-pencil-square-o"></i> Mass Update
|
|
56
|
-
</button>
|
|
57
|
-
<button type="button" class="btn btn-outline-secondary" data-test="open-modal-mass-selection-btn"
|
|
58
|
-
(click)="openCompositeModal('mass-selection')" [disabled]="isMassSelectionDisabled">
|
|
59
|
-
<i class="fa fa-check-square-o"></i> Update Selected
|
|
60
|
-
</button>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<angular-slickgrid gridId="grid30"
|
|
66
|
-
[columnDefinitions]="columnDefinitions"
|
|
67
|
-
[gridOptions]="gridOptions"
|
|
68
|
-
[dataset]="dataset"
|
|
69
|
-
(onAngularGridCreated)="angularGridReady($event.detail)"
|
|
70
|
-
(onBeforeEditCell)="handleOnBeforeEditCell($event.detail.eventData, $event.detail.args)"
|
|
71
|
-
(onCellChange)="handleOnCellChange($event.detail.eventData, $event.detail.args)"
|
|
72
|
-
(onClick)="handleOnCellClicked($event.detail.eventData, $event.detail.args)"
|
|
73
|
-
(onCompositeEditorChange)="handleOnCompositeEditorChange($event.detail.eventData, $event.detail.args)"
|
|
74
|
-
(onItemDeleted)="handleItemDeleted($event.detail.eventData, $event.detail.args)"
|
|
75
|
-
(onGridStateChanged)="handleOnGridStateChanged($event.detail)"
|
|
76
|
-
(onPaginationChanged)="handlePaginationChanged()"
|
|
77
|
-
(onValidationError)="handleValidationError($event.detail.eventData, $event.detail.args)">
|
|
78
|
-
</angular-slickgrid>
|
|
79
|
-
</div>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
$slick-button-border-color: #ababab !default;
|
|
2
|
-
|
|
3
|
-
.editable-field {
|
|
4
|
-
background-color: rgba(227, 240, 251, 0.569) !important;
|
|
5
|
-
}
|
|
6
|
-
.unsaved-editable-field {
|
|
7
|
-
background-color: #fbfdd1 !important;
|
|
8
|
-
}
|
|
9
|
-
.button-style {
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
background-color: white;
|
|
12
|
-
border: 1px solid #{$slick-button-border-color};
|
|
13
|
-
border-radius: 2px;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
text-align: center;
|
|
16
|
-
&:hover {
|
|
17
|
-
border-color: darken($slick-button-border-color, 10%);
|
|
18
|
-
}
|
|
19
|
-
}
|