angular-slickgrid 9.0.0 → 9.0.2
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/LICENSE +1 -1
- package/{dist/fesm2022 → fesm2022}/angular-slickgrid.mjs +16 -16
- package/package.json +27 -14
- package/.gitbook.yaml +0 -5
- package/CHANGELOG.md +0 -1691
- package/CONTRIBUTING.md +0 -17
- package/angular.json +0 -133
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/clover.xml +0 -1620
- package/coverage/coverage-final.json +0 -9
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -176
- package/coverage/library/components/angular-slickgrid.component.ts.html +0 -5074
- package/coverage/library/components/index.html +0 -116
- package/coverage/library/constants.ts.html +0 -397
- package/coverage/library/extensions/index.html +0 -116
- package/coverage/library/extensions/slickRowDetailView.ts.html +0 -1261
- package/coverage/library/index.html +0 -116
- package/coverage/library/modules/angular-slickgrid.module.ts.html +0 -166
- package/coverage/library/modules/index.html +0 -116
- package/coverage/library/services/angularUtil.service.ts.html +0 -445
- package/coverage/library/services/container.service.ts.html +0 -163
- package/coverage/library/services/index.html +0 -161
- package/coverage/library/services/translater.service.ts.html +0 -199
- package/coverage/library/services/utilities.ts.html +0 -142
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
- package/dist/LICENSE +0 -21
- package/dist/README.md +0 -142
- package/docs/README.md +0 -5
- package/docs/TOC.md +0 -105
- package/docs/backend-services/Custom-Backend-Service.md +0 -50
- package/docs/backend-services/GraphQL.md +0 -276
- package/docs/backend-services/OData.md +0 -245
- package/docs/backend-services/graphql/GraphQL-Filtering.md +0 -156
- package/docs/backend-services/graphql/GraphQL-JSON-Result.md +0 -85
- package/docs/backend-services/graphql/GraphQL-Pagination.md +0 -77
- package/docs/backend-services/graphql/GraphQL-Sorting.md +0 -78
- package/docs/column-functionalities/cell-menu.md +0 -212
- package/docs/column-functionalities/editors/autocomplete-editor.md +0 -466
- package/docs/column-functionalities/editors/date-editor-flatpickr.md +0 -71
- package/docs/column-functionalities/editors/date-editor-vanilla-calendar.md +0 -91
- package/docs/column-functionalities/editors/longtext-editor-textarea.md +0 -80
- package/docs/column-functionalities/editors/select-dropdown-editor.md +0 -227
- package/docs/column-functionalities/editors.md +0 -604
- package/docs/column-functionalities/filters/autocomplete-filter.md +0 -183
- package/docs/column-functionalities/filters/compound-filters.md +0 -234
- package/docs/column-functionalities/filters/custom-filter.md +0 -117
- package/docs/column-functionalities/filters/filter-intro.md +0 -81
- package/docs/column-functionalities/filters/input-filter.md +0 -260
- package/docs/column-functionalities/filters/range-filters.md +0 -188
- package/docs/column-functionalities/filters/select-filter.md +0 -695
- package/docs/column-functionalities/filters/single-search-filter.md +0 -77
- package/docs/column-functionalities/filters/styling-filled-filters.md +0 -45
- package/docs/column-functionalities/formatters.md +0 -325
- package/docs/column-functionalities/sorting.md +0 -200
- package/docs/developer-guides/csp-compliance.md +0 -64
- package/docs/events/Available-Events.md +0 -223
- package/docs/events/Grid-&-DataView-Events.md +0 -211
- package/docs/getting-started/quick-start.md +0 -230
- package/docs/getting-started/troubleshooting.md +0 -80
- package/docs/grid-functionalities/Column-Picker.md +0 -22
- package/docs/grid-functionalities/Composite-Editor-Modal.md +0 -627
- package/docs/grid-functionalities/Context-Menu.md +0 -226
- package/docs/grid-functionalities/Custom-Footer.md +0 -80
- package/docs/grid-functionalities/Custom-Tooltip-(plugin).md +0 -258
- package/docs/grid-functionalities/Export-to-Excel.md +0 -457
- package/docs/grid-functionalities/Export-to-Text-File.md +0 -165
- package/docs/grid-functionalities/FAQ.md +0 -53
- package/docs/grid-functionalities/Global-Options.md +0 -29
- package/docs/grid-functionalities/Grid-Auto-Resize.md +0 -218
- package/docs/grid-functionalities/Grid-Menu.md +0 -134
- package/docs/grid-functionalities/Grid-State-&-Preset.md +0 -245
- package/docs/grid-functionalities/Header-Menu-&-Header-Buttons.md +0 -125
- package/docs/grid-functionalities/Resize-by-Cell-Content.md +0 -138
- package/docs/grid-functionalities/Row-Selection.md +0 -247
- package/docs/grid-functionalities/Row-based-edit.md +0 -71
- package/docs/grid-functionalities/add-update-highlight.md +0 -258
- package/docs/grid-functionalities/column-row-spanning.md +0 -74
- package/docs/grid-functionalities/dynamic-item-metadata.md +0 -124
- package/docs/grid-functionalities/excel-copy-buffer.md +0 -145
- package/docs/grid-functionalities/frozen-columns-rows.md +0 -164
- package/docs/grid-functionalities/grouping-and-aggregators.md +0 -269
- package/docs/grid-functionalities/header-footer-slots.md +0 -22
- package/docs/grid-functionalities/infinite-scroll.md +0 -150
- package/docs/grid-functionalities/providing-grid-data.md +0 -61
- package/docs/grid-functionalities/row-detail.md +0 -530
- package/docs/grid-functionalities/tree-data-grid.md +0 -391
- package/docs/localization/Localization---Component-Sample.md +0 -87
- package/docs/localization/Localization-with-Custom-Locales.md +0 -66
- package/docs/localization/Localization-with-ngx-translate.md +0 -148
- package/docs/migrations/migration-to-2.x.md +0 -304
- package/docs/migrations/migration-to-3.x.md +0 -295
- package/docs/migrations/migration-to-4.x.md +0 -83
- package/docs/migrations/migration-to-5.x.md +0 -160
- package/docs/migrations/migration-to-6.x.md +0 -128
- package/docs/migrations/migration-to-7.x.md +0 -294
- package/docs/migrations/migration-to-8.x.md +0 -316
- package/docs/migrations/migration-to-9.x.md +0 -219
- package/docs/slick-grid-dataview-objects/slickgrid-dataview-objects.md +0 -79
- package/docs/styling/dark-mode.md +0 -100
- package/docs/styling/styling.md +0 -250
- package/docs/testing/testing-patterns.md +0 -73
- package/eslint.config.mjs +0 -60
- package/ng-package.json +0 -10
- package/src/assets/angular-logo.png +0 -0
- package/src/assets/angular-logo2.png +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/data/users.csv +0 -5
- package/src/assets/i18n/en.json +0 -102
- package/src/assets/i18n/fr.json +0 -103
- package/src/demos/app-routing.module.ts +0 -108
- package/src/demos/app.component.html +0 -187
- package/src/demos/app.component.scss +0 -79
- package/src/demos/app.component.ts +0 -11
- package/src/demos/app.module.ts +0 -196
- package/src/demos/environments/environment.dev.ts +0 -3
- package/src/demos/environments/environment.prod.ts +0 -3
- package/src/demos/environments/environment.ts +0 -8
- package/src/demos/examples/custom-angularComponentEditor.ts +0 -187
- package/src/demos/examples/custom-angularComponentFilter.ts +0 -123
- package/src/demos/examples/custom-buttonFormatter.component.ts +0 -13
- package/src/demos/examples/custom-inputEditor.ts +0 -132
- package/src/demos/examples/custom-inputFilter.ts +0 -134
- package/src/demos/examples/custom-titleFormatter.component.ts +0 -9
- package/src/demos/examples/data/collection_100_numbers.json +0 -12
- package/src/demos/examples/data/collection_500_numbers.json +0 -52
- package/src/demos/examples/data/countries.json +0 -245
- package/src/demos/examples/data/country_names.json +0 -245
- package/src/demos/examples/data/customers_100.json +0 -102
- package/src/demos/examples/data/users.csv +0 -5
- package/src/demos/examples/editor-ng-select.component.ts +0 -38
- package/src/demos/examples/example01.component.html +0 -48
- package/src/demos/examples/example01.component.ts +0 -109
- package/src/demos/examples/example02.component.html +0 -45
- package/src/demos/examples/example02.component.ts +0 -218
- package/src/demos/examples/example03.component.html +0 -118
- package/src/demos/examples/example03.component.ts +0 -694
- package/src/demos/examples/example04.component.html +0 -87
- package/src/demos/examples/example04.component.ts +0 -326
- package/src/demos/examples/example05.component.html +0 -151
- package/src/demos/examples/example05.component.ts +0 -474
- package/src/demos/examples/example06.component.html +0 -163
- package/src/demos/examples/example06.component.ts +0 -446
- package/src/demos/examples/example07.component.html +0 -56
- package/src/demos/examples/example07.component.scss +0 -10
- package/src/demos/examples/example07.component.ts +0 -216
- package/src/demos/examples/example08.component.html +0 -51
- package/src/demos/examples/example08.component.scss +0 -23
- package/src/demos/examples/example08.component.ts +0 -195
- package/src/demos/examples/example09.component.html +0 -55
- package/src/demos/examples/example09.component.scss +0 -22
- package/src/demos/examples/example09.component.ts +0 -302
- package/src/demos/examples/example10.component.html +0 -103
- package/src/demos/examples/example10.component.ts +0 -309
- package/src/demos/examples/example11.component.html +0 -91
- package/src/demos/examples/example11.component.ts +0 -276
- package/src/demos/examples/example12.component.html +0 -98
- package/src/demos/examples/example12.component.ts +0 -317
- package/src/demos/examples/example13.component.html +0 -96
- package/src/demos/examples/example13.component.ts +0 -370
- package/src/demos/examples/example14.component.html +0 -50
- package/src/demos/examples/example14.component.scss +0 -11
- package/src/demos/examples/example14.component.ts +0 -156
- package/src/demos/examples/example15.component.html +0 -56
- package/src/demos/examples/example15.component.ts +0 -304
- package/src/demos/examples/example16.component.html +0 -77
- package/src/demos/examples/example16.component.ts +0 -277
- package/src/demos/examples/example17.component.html +0 -50
- package/src/demos/examples/example17.component.ts +0 -109
- package/src/demos/examples/example18.component.html +0 -132
- package/src/demos/examples/example18.component.ts +0 -445
- package/src/demos/examples/example19-rowdetail.component.html +0 -40
- package/src/demos/examples/example19-rowdetail.component.ts +0 -54
- package/src/demos/examples/example19.component.html +0 -79
- package/src/demos/examples/example19.component.ts +0 -316
- package/src/demos/examples/example20.component.html +0 -76
- package/src/demos/examples/example20.component.scss +0 -11
- package/src/demos/examples/example20.component.ts +0 -341
- package/src/demos/examples/example21.component.html +0 -86
- package/src/demos/examples/example21.component.scss +0 -16
- package/src/demos/examples/example21.component.ts +0 -140
- package/src/demos/examples/example22.component.html +0 -41
- package/src/demos/examples/example22.component.ts +0 -117
- package/src/demos/examples/example23.component.html +0 -111
- package/src/demos/examples/example23.component.ts +0 -323
- package/src/demos/examples/example24.component.html +0 -120
- package/src/demos/examples/example24.component.scss +0 -62
- package/src/demos/examples/example24.component.ts +0 -641
- package/src/demos/examples/example25.component.html +0 -60
- package/src/demos/examples/example25.component.scss +0 -8
- package/src/demos/examples/example25.component.ts +0 -255
- package/src/demos/examples/example26.component.html +0 -98
- package/src/demos/examples/example26.component.scss +0 -42
- package/src/demos/examples/example26.component.ts +0 -383
- package/src/demos/examples/example27.component.html +0 -138
- package/src/demos/examples/example27.component.scss +0 -10
- package/src/demos/examples/example27.component.ts +0 -369
- package/src/demos/examples/example28.component.html +0 -143
- package/src/demos/examples/example28.component.scss +0 -54
- package/src/demos/examples/example28.component.ts +0 -453
- package/src/demos/examples/example29.component.html +0 -30
- package/src/demos/examples/example29.component.ts +0 -70
- package/src/demos/examples/example30.component.html +0 -116
- package/src/demos/examples/example30.component.scss +0 -20
- package/src/demos/examples/example30.component.ts +0 -1070
- package/src/demos/examples/example32.component.html +0 -77
- package/src/demos/examples/example32.component.scss +0 -8
- package/src/demos/examples/example32.component.ts +0 -905
- package/src/demos/examples/example33.component.html +0 -50
- package/src/demos/examples/example33.component.scss +0 -46
- package/src/demos/examples/example33.component.ts +0 -571
- package/src/demos/examples/example34.component.html +0 -82
- package/src/demos/examples/example34.component.scss +0 -77
- package/src/demos/examples/example34.component.ts +0 -434
- package/src/demos/examples/example35.component.html +0 -77
- package/src/demos/examples/example35.component.scss +0 -18
- package/src/demos/examples/example35.component.ts +0 -264
- package/src/demos/examples/example36.component.html +0 -56
- package/src/demos/examples/example36.component.scss +0 -26
- package/src/demos/examples/example36.component.ts +0 -504
- package/src/demos/examples/example37.component.html +0 -30
- package/src/demos/examples/example37.component.ts +0 -123
- package/src/demos/examples/example38.component.html +0 -104
- package/src/demos/examples/example38.component.scss +0 -8
- package/src/demos/examples/example38.component.ts +0 -420
- package/src/demos/examples/example39.component.html +0 -112
- package/src/demos/examples/example39.component.scss +0 -8
- package/src/demos/examples/example39.component.ts +0 -371
- package/src/demos/examples/example40.component.html +0 -76
- package/src/demos/examples/example40.component.ts +0 -226
- package/src/demos/examples/example41.component.html +0 -50
- package/src/demos/examples/example41.component.scss +0 -42
- package/src/demos/examples/example41.component.ts +0 -229
- package/src/demos/examples/example42.component.html +0 -47
- package/src/demos/examples/example42.component.ts +0 -203
- package/src/demos/examples/example43.component.html +0 -94
- package/src/demos/examples/example43.component.scss +0 -30
- package/src/demos/examples/example43.component.ts +0 -449
- package/src/demos/examples/example44.component.html +0 -78
- package/src/demos/examples/example44.component.scss +0 -50
- package/src/demos/examples/example44.component.ts +0 -375
- package/src/demos/examples/example45-detail.component.html +0 -15
- package/src/demos/examples/example45-detail.component.ts +0 -97
- package/src/demos/examples/example45.component.html +0 -110
- package/src/demos/examples/example45.component.scss +0 -50
- package/src/demos/examples/example45.component.ts +0 -243
- package/src/demos/examples/filter-ng-select.component.ts +0 -33
- package/src/demos/examples/grid-custom-pager.component.html +0 -60
- package/src/demos/examples/grid-custom-pager.component.scss +0 -57
- package/src/demos/examples/grid-custom-pager.component.ts +0 -107
- package/src/demos/examples/grid-remote.component.html +0 -44
- package/src/demos/examples/grid-remote.component.ts +0 -164
- package/src/demos/examples/home.component.html +0 -39
- package/src/demos/examples/home.component.ts +0 -10
- package/src/demos/examples/jsonp.ts +0 -89
- package/src/demos/examples/rowdetail-preload.component.ts +0 -10
- package/src/demos/examples/swt-common-grid-pagination.component.ts +0 -160
- package/src/demos/examples/swt-common-grid-test.component.html +0 -37
- package/src/demos/examples/swt-common-grid-test.component.ts +0 -214
- package/src/demos/examples/swt-common-grid.component.ts +0 -436
- package/src/demos/examples/swt-logger.service.ts +0 -173
- package/src/demos/examples/utilities.ts +0 -9
- package/src/favicon.ico +0 -0
- package/src/index.html +0 -17
- package/src/library/components/__tests__/angular-slickgrid.component.spec.ts +0 -2638
- package/src/library/components/angular-slickgrid.component.html +0 -5
- package/src/library/components/angular-slickgrid.component.ts +0 -1662
- package/src/library/constants.ts +0 -105
- package/src/library/extensions/__tests__/slickRowDetailView.spec.ts +0 -751
- package/src/library/extensions/index.ts +0 -1
- package/src/library/extensions/slickRowDetailView.ts +0 -395
- package/src/library/global-grid-options.ts +0 -273
- package/src/library/index.ts +0 -11
- package/src/library/models/angularComponentOutput.interface.ts +0 -6
- package/src/library/models/angularGridInstance.interface.ts +0 -76
- package/src/library/models/externalTestingDependencies.interface.ts +0 -37
- package/src/library/models/gridOption.interface.ts +0 -15
- package/src/library/models/index.ts +0 -5
- package/src/library/models/rowDetailView.interface.ts +0 -16
- package/src/library/modules/angular-slickgrid.module.spec.ts +0 -25
- package/src/library/modules/angular-slickgrid.module.ts +0 -27
- package/src/library/services/__tests__/angularUtilService.spec.ts +0 -156
- package/src/library/services/__tests__/container.service.spec.ts +0 -25
- package/src/library/services/__tests__/translater.service.spec.ts +0 -43
- package/src/library/services/__tests__/utilities.spec.ts +0 -22
- package/src/library/services/angularUtil.service.ts +0 -120
- package/src/library/services/container.service.ts +0 -26
- package/src/library/services/index.ts +0 -4
- package/src/library/services/translater.service.ts +0 -38
- package/src/library/services/utilities.ts +0 -19
- package/src/library/slickgrid-config.ts +0 -10
- package/src/main.ts +0 -13
- package/src/public_api.ts +0 -1
- package/src/styles.scss +0 -178
- package/test/cypress/e2e/example01.cy.ts +0 -367
- package/test/cypress/e2e/example02.cy.ts +0 -60
- package/test/cypress/e2e/example03.cy.ts +0 -268
- package/test/cypress/e2e/example04.cy.ts +0 -254
- package/test/cypress/e2e/example05.cy.ts +0 -804
- package/test/cypress/e2e/example06.cy.ts +0 -890
- package/test/cypress/e2e/example07.cy.ts +0 -384
- package/test/cypress/e2e/example08.cy.ts +0 -190
- package/test/cypress/e2e/example09.cy.ts +0 -392
- package/test/cypress/e2e/example10.cy.ts +0 -650
- package/test/cypress/e2e/example11.cy.ts +0 -86
- package/test/cypress/e2e/example12.cy.ts +0 -269
- package/test/cypress/e2e/example13.cy.ts +0 -246
- package/test/cypress/e2e/example14.cy.ts +0 -122
- package/test/cypress/e2e/example15.cy.ts +0 -598
- package/test/cypress/e2e/example16.cy.ts +0 -427
- package/test/cypress/e2e/example17.cy.ts +0 -83
- package/test/cypress/e2e/example18.cy.ts +0 -431
- package/test/cypress/e2e/example19.cy.ts +0 -263
- package/test/cypress/e2e/example20.cy.ts +0 -264
- package/test/cypress/e2e/example21.cy.ts +0 -77
- package/test/cypress/e2e/example22.cy.ts +0 -94
- package/test/cypress/e2e/example23.cy.ts +0 -259
- package/test/cypress/e2e/example24.cy.ts +0 -707
- package/test/cypress/e2e/example25.cy.ts +0 -193
- package/test/cypress/e2e/example26.cy.ts +0 -111
- package/test/cypress/e2e/example27.cy.ts +0 -261
- package/test/cypress/e2e/example28.cy.ts +0 -740
- package/test/cypress/e2e/example29.cy.ts +0 -30
- package/test/cypress/e2e/example30.cy.ts +0 -757
- package/test/cypress/e2e/example31.cy.ts +0 -69
- package/test/cypress/e2e/example32.cy.ts +0 -272
- package/test/cypress/e2e/example33.cy.ts +0 -278
- package/test/cypress/e2e/example34.cy.ts +0 -84
- package/test/cypress/e2e/example35.cy.ts +0 -178
- package/test/cypress/e2e/example36.cy.ts +0 -219
- package/test/cypress/e2e/example37.cy.ts +0 -52
- package/test/cypress/e2e/example38.cy.ts +0 -160
- package/test/cypress/e2e/example39.cy.ts +0 -150
- package/test/cypress/e2e/example40.cy.ts +0 -126
- package/test/cypress/e2e/example41.cy.ts +0 -90
- package/test/cypress/e2e/example42.cy.ts +0 -82
- package/test/cypress/e2e/example43.cy.ts +0 -482
- package/test/cypress/e2e/example44.cy.ts +0 -458
- package/test/cypress/e2e/example45.cy.ts +0 -455
- package/test/cypress/e2e/home.cy.ts +0 -7
- package/test/cypress/fixtures/example.json +0 -5
- package/test/cypress/plugins/index.ts +0 -17
- package/test/cypress/plugins/utilities.ts +0 -28
- package/test/cypress/support/commands.ts +0 -88
- package/test/cypress/support/common.ts +0 -47
- package/test/cypress/support/drag.ts +0 -101
- package/test/cypress/support/index.ts +0 -20
- package/test/cypress/tsconfig.json +0 -9
- package/test/cypress.config.ts +0 -34
- package/test/mockSlickEvent.ts +0 -77
- package/test/rxjsResourceStub.ts +0 -69
- package/test/test-setup.ts +0 -6
- package/test/translateServiceStub.ts +0 -230
- package/test/translaterServiceStub.ts +0 -239
- package/test/tsconfig.json +0 -17
- package/test/vitest-global-mocks.ts +0 -41
- package/test/vitest-global-setup.ts +0 -3
- package/test/vitest-pretest.ts +0 -5
- package/tsconfig.app.json +0 -14
- package/tsconfig.json +0 -31
- package/tsconfig.spec.json +0 -11
- package/types/sortablejs.d.ts +0 -4
- package/vite.config.mts +0 -51
- /package/{dist/fesm2022 → fesm2022}/angular-slickgrid.mjs.map +0 -0
- /package/{dist/i18n → i18n}/en.json +0 -0
- /package/{dist/i18n → i18n}/fr.json +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/library → library}/components/angular-slickgrid.component.d.ts +0 -0
- /package/{dist/library → library}/constants.d.ts +0 -0
- /package/{dist/library → library}/extensions/index.d.ts +0 -0
- /package/{dist/library → library}/extensions/slickRowDetailView.d.ts +0 -0
- /package/{dist/library → library}/global-grid-options.d.ts +0 -0
- /package/{dist/library → library}/index.d.ts +0 -0
- /package/{dist/library → library}/models/angularComponentOutput.interface.d.ts +0 -0
- /package/{dist/library → library}/models/angularGridInstance.interface.d.ts +0 -0
- /package/{dist/library → library}/models/externalTestingDependencies.interface.d.ts +0 -0
- /package/{dist/library → library}/models/gridOption.interface.d.ts +0 -0
- /package/{dist/library → library}/models/index.d.ts +0 -0
- /package/{dist/library → library}/models/rowDetailView.interface.d.ts +0 -0
- /package/{dist/library → library}/modules/angular-slickgrid.module.d.ts +0 -0
- /package/{dist/library → library}/services/angularUtil.service.d.ts +0 -0
- /package/{dist/library → library}/services/container.service.d.ts +0 -0
- /package/{dist/library → library}/services/index.d.ts +0 -0
- /package/{dist/library → library}/services/translater.service.d.ts +0 -0
- /package/{dist/library → library}/services/utilities.d.ts +0 -0
- /package/{dist/library → library}/slickgrid-config.d.ts +0 -0
- /package/{dist/public_api.d.ts → public_api.d.ts} +0 -0
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
## CSP Compliance
|
|
2
|
-
The library is for the most part CSP (Content Security Policy) compliant since `v7.0` **but** only if you configure the `sanitizer` grid option. We were previously using `DOMPurify` internally in the project (in version <=7.x) but it was made optional in version 8 and higher. The main reason to make it optional was because some users who require SSR support could not use `dompuriy` but would rather need to use `isomorphic-dompurify`. You could also skip the `sanitizer` configuration, but that is not recommended.
|
|
3
|
-
|
|
4
|
-
> **Note** even if the `sanitizer` is optional, we **strongly suggest** that you configure it as a global grid option to avoid possible XSS attacks from your data and also to be CSP compliant. Note that for Salesforce users, you do not have to configure it since Salesforce is already using DOMPurify internally for any HTML templates.
|
|
5
|
-
|
|
6
|
-
As mentioned above, the project is mostly CSP compliant, however there are some exceptions to be aware of. When using any html string as template (for example with Custom Formatter returning an html string), you will not be fully compliant unless you return `TrustedHTML`. You can achieve this by using the `sanitizer` method in combo with [DOMPurify](https://github.com/cure53/DOMPurify) to return `TrustedHTML` as shown below and with that in place you should be CSP compliant.
|
|
7
|
-
|
|
8
|
-
```ts
|
|
9
|
-
// prefer the global grid options if possible
|
|
10
|
-
this.gridOptions = {
|
|
11
|
-
sanitizer: (dirtyHtml) => DOMPurify.sanitize(dirtyHtml, { ADD_ATTR: ['level'], RETURN_TRUSTED_TYPE: true })
|
|
12
|
-
};
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
> **Note** If you're wondering about the `ADD_ATTR: ['level']`, well the "level" is a custom attribute used by SlickGrid Grouping/Draggable Grouping to track the grouping level depth and it must be kept.
|
|
16
|
-
|
|
17
|
-
> **Note** the DataView is not CSP safe by default, it is opt-in via the `useCSPSafeFilter` option.
|
|
18
|
-
|
|
19
|
-
```typescript
|
|
20
|
-
import DOMPurify from 'dompurify';
|
|
21
|
-
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
|
|
22
|
-
|
|
23
|
-
// DOM Purify is already configured in Slickgrid-Universal with the configuration shown below
|
|
24
|
-
this.gridOptions = {
|
|
25
|
-
sanitizer: (html) => DOMPurify.sanitize(html, { RETURN_TRUSTED_TYPE: true }),
|
|
26
|
-
// you could also optionally use the sanitizerOptions instead
|
|
27
|
-
// sanitizerOptions: { RETURN_TRUSTED_TYPE: true }
|
|
28
|
-
}
|
|
29
|
-
this.sgb = new Slicker.GridBundle(gridContainerElm, this.columnDefinitions, this.gridOptions, this.dataset);
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
with this code in place, we can use the following CSP meta tag (which is what we use in the lib demo, ref: [index.html](https://github.com/ghiscoding/slickgrid-universal/blob/master/examples/vite-demo-vanilla-bundle/index.html#L8-L14))
|
|
33
|
-
```html
|
|
34
|
-
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'nonce-random-string'; require-trusted-types-for 'script'; trusted-types dompurify">
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
#### DataView
|
|
38
|
-
Since we use the DataView, you will also need to enable a new `useCSPSafeFilter` flag to be CSP safe as the name suggest. This option is opt-in because it has a slight performance impact when enabling this option (it shouldn't be noticeable unless you use a very large dataset).
|
|
39
|
-
|
|
40
|
-
```typescript
|
|
41
|
-
import DOMPurify from 'dompurify';
|
|
42
|
-
import { GridOption } from 'angular-slickgrid';
|
|
43
|
-
|
|
44
|
-
export class Example1 {
|
|
45
|
-
gridOptions: GridOption;
|
|
46
|
-
|
|
47
|
-
prepareGrid() {
|
|
48
|
-
// ...
|
|
49
|
-
|
|
50
|
-
this.gridOptions = {
|
|
51
|
-
// you could also optionally use the sanitizerOptions instead
|
|
52
|
-
// sanitizerOptions: { RETURN_TRUSTED_TYPE: true }
|
|
53
|
-
dataView: {
|
|
54
|
-
useCSPSafeFilter: true
|
|
55
|
-
},
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Custom Formatter using native HTML
|
|
62
|
-
We now also allow passing native HTML Element as a Custom Formatter instead of HTML string in order to avoid the use of `innerHTML` and stay CSP safe. We also have a new grid option named `enableHtmlRendering`, which is enabled by default and is allowing the use of `innerHTML` in the library (by Formatters and others), however when disabled it will totally restrict the use of `innerHTML` which will help to stay CSP safe.
|
|
63
|
-
|
|
64
|
-
You can take a look at the original SlickGrid library with this new [Filtered DataView with HTML Formatter - CSP Header (Content Security Policy)](https://6pac.github.io/SlickGrid/examples/example4-model-html-formatters.html) example which uses this new approach. There was no new Example created in Slickgrid-Universal specifically for this but the approach is the same.
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
## Full list of Events by Categories
|
|
2
|
-
|
|
3
|
-
(see below for full list of events)
|
|
4
|
-
|
|
5
|
-
All the events are published with a data payload in a `CustomEvent`, so you will typically find the payload under the `detail` property of the `CustomEvent`. However please note that the events from `SlickGrid` and `SlickDataView`, shown at the bottom of the list, are published with a different structure which is also including the JS event that it was triggered with under the property `eventData` and the payload itself is under the `args` property (which follows original SlickGrid structure). To subscribe to all events, you can use your PubSub instance (if available) or add listeners on your grid container DOM element.
|
|
6
|
-
|
|
7
|
-
#### `SlickGrid` and `SlickDataView`
|
|
8
|
-
```ts
|
|
9
|
-
// 1. with PubSub instance
|
|
10
|
-
this.angularGrid.instances?.eventPubSubService?.subscribe('onCellChange', (payload) => console.log('PubSub, cell changed data:', payload));
|
|
11
|
-
|
|
12
|
-
// 2. with CustomEvent in the View (see html code below)
|
|
13
|
-
handleOnCellChange(e) {
|
|
14
|
-
// `eventData` is the event it was triggered from and `args` is the data payload
|
|
15
|
-
const { eventData, args } = e.detail;
|
|
16
|
-
const dataContext = args?.item;
|
|
17
|
-
console.log('cell changed data:', args);
|
|
18
|
-
}
|
|
19
|
-
```
|
|
20
|
-
```html
|
|
21
|
-
<!-- 2. with CustomEvent in the View -->
|
|
22
|
-
<angular-slickgrid
|
|
23
|
-
gridId="grid2"
|
|
24
|
-
[columns]="columnDefinitions"
|
|
25
|
-
[options]="gridOptions"
|
|
26
|
-
[dataset]="dataset"
|
|
27
|
-
(onCellChange)="handleOnCellChange($event.detail)">
|
|
28
|
-
</angular-slickgrid>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
#### all other events
|
|
32
|
-
```ts
|
|
33
|
-
// 1. with PubSub instance
|
|
34
|
-
this.angularGrid.instances?.eventPubSubService?.subscribe('onHeaderMenuCommand', (payload) => console.log('PubSub, header menu command', payload));
|
|
35
|
-
|
|
36
|
-
// 2. with CustomEvent in the View (see html code below)
|
|
37
|
-
handleOnHeaderMenuCommand(e) {
|
|
38
|
-
// detail is the args data payload
|
|
39
|
-
const args = e.detail;
|
|
40
|
-
console.log('header menu command', args);
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
```html
|
|
44
|
-
<!-- 2. with CustomEvent in the View -->
|
|
45
|
-
<angular-slickgrid
|
|
46
|
-
gridId="grid2"
|
|
47
|
-
[columns]="columnDefinitions"
|
|
48
|
-
[options]="gridOptions"
|
|
49
|
-
[dataset]="dataset"
|
|
50
|
-
(onHeaderMenuCommand)="handleOnHeaderMenuCommand($event.detail)">
|
|
51
|
-
</angular-slickgrid>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
#### CellExternalCopyManager (extension)
|
|
57
|
-
- `onCopyCells`
|
|
58
|
-
- `onCopyCancelled`
|
|
59
|
-
- `onPasteCells`
|
|
60
|
-
- `onBeforePasteCell`
|
|
61
|
-
|
|
62
|
-
#### Context Menu / Cell Menu (extension)
|
|
63
|
-
- `onContextMenuClearGrouping`
|
|
64
|
-
- `onContextMenuCollapseAllGroups`
|
|
65
|
-
- `onContextMenuExpandAllGroups`
|
|
66
|
-
- **Slick Events**
|
|
67
|
-
- `onAfterMenuShow`
|
|
68
|
-
- `onBeforeMenuShow`
|
|
69
|
-
- `onBeforeMenuClose`
|
|
70
|
-
- `onCommand`
|
|
71
|
-
- `onOptionSelected`
|
|
72
|
-
|
|
73
|
-
#### Column Picker (extension)
|
|
74
|
-
- `onColumnPickerColumnsChanged`
|
|
75
|
-
- **Slick Events**
|
|
76
|
-
- `onColumnsChanged`
|
|
77
|
-
|
|
78
|
-
#### Grid Menu (extension)
|
|
79
|
-
- `onGridMenuMenuClose`
|
|
80
|
-
- `onGridMenuBeforeMenuShow`
|
|
81
|
-
- `onGridMenuAfterMenuShow`
|
|
82
|
-
- `onGridMenuClearAllPinning`
|
|
83
|
-
- `onGridMenuClearAllFilters`
|
|
84
|
-
- `onGridMenuClearAllSorting`
|
|
85
|
-
- `onGridMenuColumnsChanged`
|
|
86
|
-
- `onGridMenuCommand`
|
|
87
|
-
- **Slick Events**
|
|
88
|
-
- `onAfterMenuShow`
|
|
89
|
-
- `onBeforeMenuShow`
|
|
90
|
-
- `onBeforeMenuClose`
|
|
91
|
-
- `onColumnsChanged`
|
|
92
|
-
- `onMenuClose`
|
|
93
|
-
- `onCommand`
|
|
94
|
-
|
|
95
|
-
#### Header Buttons (extension)
|
|
96
|
-
- `onHeaderButtonCommand`
|
|
97
|
-
|
|
98
|
-
#### Header Menu (extension)
|
|
99
|
-
- `onHeaderMenuCommand`
|
|
100
|
-
- `onHeaderMenuColumnResizeByContent`
|
|
101
|
-
- `onHeaderMenuBeforeMenuShow`
|
|
102
|
-
- `onHeaderMenuAfterMenuShow`
|
|
103
|
-
|
|
104
|
-
#### Filter Service
|
|
105
|
-
- `onBeforeFilterClear`
|
|
106
|
-
- `onBeforeSearchChange`
|
|
107
|
-
- `onFilterCleared`
|
|
108
|
-
|
|
109
|
-
#### Grid Service
|
|
110
|
-
- `onHideColumns`
|
|
111
|
-
- `onItemsAdded`
|
|
112
|
-
- `onItemsDeleted`
|
|
113
|
-
- `onItemsUpdated`
|
|
114
|
-
- `onItemsUpserted`
|
|
115
|
-
|
|
116
|
-
#### GridState Service
|
|
117
|
-
- `onFullResizeByContentRequested`
|
|
118
|
-
- `onGridStateChanged`
|
|
119
|
-
|
|
120
|
-
#### Pagination Service
|
|
121
|
-
- `onBeforePaginationChange`
|
|
122
|
-
- `onPaginationChanged`
|
|
123
|
-
- `onPaginationRefreshed`
|
|
124
|
-
- `onPaginationPresetsInitialized`
|
|
125
|
-
- `onPaginationVisibilityChanged`
|
|
126
|
-
- `onPaginationSetCursorBased` (for GraphQL only)
|
|
127
|
-
|
|
128
|
-
#### Resizer Service
|
|
129
|
-
- `onGridBeforeResize`
|
|
130
|
-
- `onGridAfterResize`
|
|
131
|
-
- `onBeforeResizeByContent`
|
|
132
|
-
- `onAfterResizeByContent`
|
|
133
|
-
|
|
134
|
-
#### Sort Service
|
|
135
|
-
- `onSortCleared`
|
|
136
|
-
- `onSortChanged`
|
|
137
|
-
- `onBeforeSortChange`
|
|
138
|
-
|
|
139
|
-
#### TreeData Service
|
|
140
|
-
- `onTreeFullToggleStart`
|
|
141
|
-
- `onTreeFullToggleEnd`
|
|
142
|
-
- `onTreeItemToggled`
|
|
143
|
-
|
|
144
|
-
#### Angular-Slickgrid Component
|
|
145
|
-
- `onBeforeGridDestroy`
|
|
146
|
-
- `onAfterGridDestroyed`
|
|
147
|
-
- `onBeforeGridCreate`
|
|
148
|
-
- `onDataviewCreated`
|
|
149
|
-
- `onGridCreated`
|
|
150
|
-
- `onAngularGridCreated`
|
|
151
|
-
- `onGridStateChanged`
|
|
152
|
-
|
|
153
|
-
#### SlickGrid
|
|
154
|
-
- `onActiveCellChanged`
|
|
155
|
-
- `onActiveCellPositionChanged`
|
|
156
|
-
- `onAddNewRow`
|
|
157
|
-
- `onAfterSetColumns`
|
|
158
|
-
- `onAutosizeColumns`
|
|
159
|
-
- `onBeforeAppendCell`
|
|
160
|
-
- `onBeforeCellEditorDestroy`
|
|
161
|
-
- `onBeforeColumnsResize`
|
|
162
|
-
- `onBeforeDestroy`
|
|
163
|
-
- `onBeforeEditCell`
|
|
164
|
-
- `onBeforeFooterRowCellDestroy`
|
|
165
|
-
- `onBeforeHeaderCellDestroy`
|
|
166
|
-
- `onBeforeHeaderRowCellDestroy`
|
|
167
|
-
- `onBeforeRemoveCachedRow`
|
|
168
|
-
- `onBeforeSetColumns`
|
|
169
|
-
- `onBeforeSort`
|
|
170
|
-
- `onBeforeUpdateColumns`
|
|
171
|
-
- `onCellChange`
|
|
172
|
-
- `onCellCssStylesChanged`
|
|
173
|
-
- `onClick`
|
|
174
|
-
- `onColumnsReordered`
|
|
175
|
-
- `onColumnsDrag`
|
|
176
|
-
- `onColumnsResized`
|
|
177
|
-
- `onColumnsResizeDblClick`
|
|
178
|
-
- `onCompositeEditorChange`
|
|
179
|
-
- `onContextMenu`
|
|
180
|
-
- `onDblClick`
|
|
181
|
-
- `onDrag`
|
|
182
|
-
- `onDragInit`
|
|
183
|
-
- `onDragStart`
|
|
184
|
-
- `onDragEnd`
|
|
185
|
-
- `onFooterClick`
|
|
186
|
-
- `onFooterContextMenu`
|
|
187
|
-
- `onFooterRowCellRendered`
|
|
188
|
-
- `onHeaderCellRendered`
|
|
189
|
-
- `onHeaderClick`
|
|
190
|
-
- `onHeaderContextMenu`
|
|
191
|
-
- `onHeaderMouseEnter`
|
|
192
|
-
- `onHeaderMouseLeave`
|
|
193
|
-
- `onHeaderMouseOver`
|
|
194
|
-
- `onHeaderMouseOut`
|
|
195
|
-
- `onHeaderRowCellRendered`
|
|
196
|
-
- `onHeaderRowMouseEnter`
|
|
197
|
-
- `onHeaderRowMouseLeave`
|
|
198
|
-
- `onHeaderRowMouseOver`
|
|
199
|
-
- `onHeaderRowMouseOut`
|
|
200
|
-
- `onKeyDown`
|
|
201
|
-
- `onMouseEnter`
|
|
202
|
-
- `onMouseLeave`
|
|
203
|
-
- `onPreHeaderClick`
|
|
204
|
-
- `onPreHeaderContextMenu`
|
|
205
|
-
- `onRendered`
|
|
206
|
-
- `onScroll`
|
|
207
|
-
- `onSelectedRowsChanged`
|
|
208
|
-
- `onSetOptions`
|
|
209
|
-
- `onActivateChangedOptions`
|
|
210
|
-
- `onSort`
|
|
211
|
-
- `onValidationError`
|
|
212
|
-
- `onViewportChanged`
|
|
213
|
-
|
|
214
|
-
#### SlickDataView
|
|
215
|
-
- `onBeforePagingInfoChanged`
|
|
216
|
-
- `onGroupExpanded`
|
|
217
|
-
- `onGroupCollapsed`
|
|
218
|
-
- `onPagingInfoChanged`
|
|
219
|
-
- `onRowCountChanged`
|
|
220
|
-
- `onRowsChanged`
|
|
221
|
-
- `onRowsOrCountChanged`
|
|
222
|
-
- `onSelectedRowIdsChanged`
|
|
223
|
-
- `onSetItemsCalled`
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
See the full list of [Available Events](Available-Events.md) which you can use by simply hook a `subscribe` to them (the `subscribe` are a custom `SlickGrid Event` and are **NOT** an `RxJS Observable` type but they very similar). You can access them in Slickgrid-Universal by following the documentation below
|
|
2
|
-
|
|
3
|
-
##### View
|
|
4
|
-
```html
|
|
5
|
-
<angular-slickgrid
|
|
6
|
-
gridId="grid2"
|
|
7
|
-
[columns]="columnDefinitions"
|
|
8
|
-
[options]="gridOptions"
|
|
9
|
-
[dataset]="dataset"
|
|
10
|
-
(onAngularGridCreated)="angularGridReady($event.detail)"
|
|
11
|
-
(onCellChange)="onCellChanged($event.detail.eventData, $event.detail.args)"
|
|
12
|
-
(onClick)="onCellClicked($event.detail.eventData, $event.detail.args)">
|
|
13
|
-
</angular-slickgrid>
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
##### Component
|
|
17
|
-
Hook yourself to the Changed event of the bindable grid object.
|
|
18
|
-
|
|
19
|
-
```typescript
|
|
20
|
-
export class GridEditorComponent {
|
|
21
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
22
|
-
this.angularGrid = angularGrid;
|
|
23
|
-
|
|
24
|
-
// the Angular Grid Instance exposes both Slick Grid & DataView objects
|
|
25
|
-
this.gridObj = angularGrid.slickGrid;
|
|
26
|
-
this.dataViewObj = angularGrid.dataView;
|
|
27
|
-
|
|
28
|
-
// it also exposes all the Services
|
|
29
|
-
// this.angularGrid.resizerService.resizeGrid(10);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
onCellChanged(e, args) {
|
|
33
|
-
this.updatedObject = args.item;
|
|
34
|
-
this.angularGrid.resizerService.resizeGrid(10);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
onCellClicked(e, args) {
|
|
38
|
-
// do something
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Example with Custom Event
|
|
44
|
-
Angular-Slickgrid can trigger the following custom events that you can hook to. However please note that `onDataviewCreated`
|
|
45
|
-
and `onGridCreated` are a lot less used now since `onAngularGridCreated` now exposes both the Slick Grid & DataView objects.
|
|
46
|
-
- `onAngularGridCreated`
|
|
47
|
-
- `onDataviewCreated`
|
|
48
|
-
- `onGridCreated`
|
|
49
|
-
- `onBeforeGridCreate`
|
|
50
|
-
- `onBeforeGridDestroy`
|
|
51
|
-
- `onAfterGridDestroyed`
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
##### View
|
|
55
|
-
Bind `(onDataviewCreated)` and `(onGridCreated)` if you want to call any `SlickGrid` legacy functions.
|
|
56
|
-
```html
|
|
57
|
-
<angular-slickgrid
|
|
58
|
-
gridId="grid2"
|
|
59
|
-
(onDataviewCreated)="dataviewReady($event)"
|
|
60
|
-
(onGridCreated)="gridReady($event)"
|
|
61
|
-
[columns]="columnDefinitions"
|
|
62
|
-
[options]="gridOptions"
|
|
63
|
-
[dataset]="dataset">
|
|
64
|
-
</angular-slickgrid>
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
##### Component
|
|
68
|
-
Once the `Grid` and `DataView` are ready, you can subscribe to any [Available Events](../events/Available-Events.md) and don't forget to **unsubscribe** to avoid unwanted behaviors and memory leak when your component is destroyed. See below for the `gridReady(grid)` and `dataviewReady(dataview)` functions.
|
|
69
|
-
- The example shown below is subscribing to `onClick` and ask the user to confirm a delete, then will delete it from the `DataView`.
|
|
70
|
-
- Technically, the `Grid` and `DataView` are created at the same time by `Angular-Slickgrid`, so it's ok to call the `dataViewObj` within some code of the `gridReady()` function since `DataView` object will already be available at that time.
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
import { Component, Input, OnInit } from '@angular/core';
|
|
74
|
-
import { Editors, Formatters, GridExtraUtils } from 'angular-slickgrid';
|
|
75
|
-
|
|
76
|
-
@Component({
|
|
77
|
-
templateUrl: './grid-editor.component.html'
|
|
78
|
-
})
|
|
79
|
-
export class GridEditorComponent implements OnInit {
|
|
80
|
-
columnDefinitions: Column[];
|
|
81
|
-
gridOptions: GridOption;
|
|
82
|
-
dataset: any[];
|
|
83
|
-
dataviewObj: any;
|
|
84
|
-
|
|
85
|
-
constructor() {}
|
|
86
|
-
|
|
87
|
-
ngOnInit(): void {
|
|
88
|
-
this.columnDefinitions = [
|
|
89
|
-
{ id: 'delete', field: 'id', formatter: Formatters.deleteIcon, maxWidth: 30 }
|
|
90
|
-
// ...
|
|
91
|
-
];
|
|
92
|
-
|
|
93
|
-
this.gridOptions = {
|
|
94
|
-
editable: true,
|
|
95
|
-
enableCellNavigation: true,
|
|
96
|
-
autoEdit: true
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
gridReady(grid) {
|
|
101
|
-
grid.onCellChange.subscribe((e, args) => {
|
|
102
|
-
console.log('onCellChange', args);
|
|
103
|
-
// for example, CRUD with WebAPI calls
|
|
104
|
-
});
|
|
105
|
-
grid.onClick.subscribe((e, args) => {
|
|
106
|
-
const column = GridExtraUtils.getColumnDefinitionAndData(args);
|
|
107
|
-
|
|
108
|
-
if (column.columnDef.id === 'delete') {
|
|
109
|
-
if (confirm('Are you sure?')) {
|
|
110
|
-
this.dataviewObj.deleteItem(column.dataContext.id);
|
|
111
|
-
this.dataviewObj.refresh();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
dataviewReady(dataview) {
|
|
118
|
-
this.dataviewObj = dataview;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### Example with `(onAngularGridCreated)`
|
|
124
|
-
Angular-Slickgrid now also expose the Slick Grid and DataView objects through the `(onAngularGridCreated)` event, for example:
|
|
125
|
-
|
|
126
|
-
##### View
|
|
127
|
-
```html
|
|
128
|
-
<span id="radioAutoEdit">
|
|
129
|
-
<label class="radio-inline control-label" for="radioTrue">
|
|
130
|
-
<input type="radio" name="inlineRadioOptions" id="radioTrue" checked [value]="isAutoEdit" (change)="setAutoEdit(true)"> ON (single-click)
|
|
131
|
-
</label>
|
|
132
|
-
<label class="radio-inline control-label" for="radioFalse">
|
|
133
|
-
<input type="radio" name="inlineRadioOptions" id="radioFalse" [value]="isAutoEdit" (change)="setAutoEdit(false)"> OFF (double-click)
|
|
134
|
-
</label>
|
|
135
|
-
</span>
|
|
136
|
-
|
|
137
|
-
<angular-slickgrid gridId="grid2"
|
|
138
|
-
[columns]="columnDefinitions"
|
|
139
|
-
[options]="gridOptions"
|
|
140
|
-
[dataset]="dataset"
|
|
141
|
-
(onAngularGridCreated)="angularGridReady($event.detail)">
|
|
142
|
-
</angular-slickgrid>
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
##### Component
|
|
146
|
-
|
|
147
|
-
```typescript
|
|
148
|
-
import { AngularGridInstance, Column, GridOption } from 'angular-slickgrid';
|
|
149
|
-
|
|
150
|
-
export class MyApp {
|
|
151
|
-
angularGrid: AngularGridInstance;
|
|
152
|
-
columnDefinitions: Column[];
|
|
153
|
-
gridOptions: GridOption;
|
|
154
|
-
dataset: any[];
|
|
155
|
-
isAutoEdit = true;
|
|
156
|
-
gridObj: any;
|
|
157
|
-
dataViewObj: any;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
161
|
-
this.angularGrid = angularGrid;
|
|
162
|
-
this.gridObj = angularGrid.slickGrid;
|
|
163
|
-
this.dataViewObj = angularGrid.dataView;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/** Change dynamically `autoEdit` grid options */
|
|
167
|
-
setAutoEdit(isAutoEdit) {
|
|
168
|
-
this.isAutoEdit = isAutoEdit;
|
|
169
|
-
this.gridObj.setOptions({ autoEdit: isAutoEdit }); // change the grid option dynamically
|
|
170
|
-
return true;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
collapseAllGroups() {
|
|
174
|
-
this.dataviewObj.collapseAllGroups();
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
expandAllGroups() {
|
|
178
|
-
this.dataviewObj.expandAllGroups();
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
### Error thrown in the IDE when using `strictTemplates`
|
|
184
|
-
You might get some error thrown in your editor by the Angular-Language-Service, the error might 1 of these
|
|
185
|
-
```shell
|
|
186
|
-
Event onAngularGridCreated is not emitted by any applicable directives nor by angular-slickgrid element
|
|
187
|
-
```
|
|
188
|
-
or
|
|
189
|
-
```shell
|
|
190
|
-
error TS2339: Property 'detail' does not exist on type 'Event'.
|
|
191
|
-
```
|
|
192
|
-
There are 3 possible solutions to fix this issue
|
|
193
|
-
1. disabled `strictTemplates`
|
|
194
|
-
2. define argument type as `Event` to avoid error then later cast it as a `CustomEvent`
|
|
195
|
-
```ts
|
|
196
|
-
angularGridReady(event: Event) {
|
|
197
|
-
this.angularGrid = (event as CustomEvent).detail as AngularGridInstance;
|
|
198
|
-
}
|
|
199
|
-
```
|
|
200
|
-
3. use `$any()` in the View
|
|
201
|
-
```html
|
|
202
|
-
<angular-slickgrid gridId="grid1"
|
|
203
|
-
[columns]="columnDefinitions"
|
|
204
|
-
[options]="gridOptions"
|
|
205
|
-
[dataset]="dataset"
|
|
206
|
-
(onAngularGridCreated)="angularGridReady($any($event).detail)">
|
|
207
|
-
</angular-slickgrid>
|
|
208
|
-
```
|
|
209
|
-
You can read more on the subject at:
|
|
210
|
-
- Stack Overflow question [Cannot use onAngularGridCreated emitter](https://stackoverflow.com/questions/71156193/cannot-use-onangulargridcreated-emitter/71245004#71245004)
|
|
211
|
-
- Discussion [#815](https://github.com/ghiscoding/angular-slickgrid/discussions/815)
|