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,125 +0,0 @@
|
|
|
1
|
-
### Demo
|
|
2
|
-
|
|
3
|
-
#### Header Button Plugin
|
|
4
|
-
[Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/headerbutton) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-headerbutton.component.ts)
|
|
5
|
-
|
|
6
|
-
#### Header Menu Plugin
|
|
7
|
-
[Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/headermenu) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-headermenu.component.ts)
|
|
8
|
-
|
|
9
|
-
## Header Menu
|
|
10
|
-
The `Header Menu` is now part of `Slickgrid-Universal` and is enabled by default via the grid option "enableHeaderMenu" flag.
|
|
11
|
-
|
|
12
|
-
### How to use it?
|
|
13
|
-
#### It's Enabled by default
|
|
14
|
-
Technically, it's enable by default and so you don't have anything to do to enjoy it. However if you want to customize the content of the Header Menu, then continue reading.
|
|
15
|
-
|
|
16
|
-
## Customization
|
|
17
|
-
### Custom Commands
|
|
18
|
-
The Header Menu also comes, by default, with a list of built-in custom commands (all their `positionOrder` are in the reserved range of 40 to 60)
|
|
19
|
-
- Sort Ascending (you can hide it with `hideSortCommands: true`)
|
|
20
|
-
- Sort Descending (you can hide it with `hideSortCommands: true`)
|
|
21
|
-
- Hide Column (you can hide it with `hideColumnHideCommand: true`)
|
|
22
|
-
|
|
23
|
-
This section is called Custom Commands because you can also customize this section with your own commands. To do that, you need to fill in 2 properties (an array of `headerMenuItems` that will go under each column definition and define `onCommand` callbacks) in your Grid Options. For example, `Slickgrid-Universal` is configured by default with these settings (you can overwrite any one of them):
|
|
24
|
-
```ts
|
|
25
|
-
this.gridOptions = {
|
|
26
|
-
enableAutoResize: true,
|
|
27
|
-
enableHeaderMenu: true, // <<-- this will automatically add extra custom commands
|
|
28
|
-
enableFiltering: true,
|
|
29
|
-
headerMenu: {
|
|
30
|
-
onCommand: (e, args) => {
|
|
31
|
-
if (args.command === 'hide') {
|
|
32
|
-
this.controlService.hideColumn(args.column);
|
|
33
|
-
this.controlService.autoResizeColumns();
|
|
34
|
-
} else if (args.command === 'sort-asc' || args.command === 'sort-desc') {
|
|
35
|
-
// get previously sorted columns
|
|
36
|
-
const cols: ColumnSort[] = this.sortService.getPreviousColumnSorts(args.column.id + '');
|
|
37
|
-
|
|
38
|
-
// add to the column array, the column sorted by the header menu
|
|
39
|
-
cols.push({ sortCol: args.column, sortAsc: (args.command === 'sort-asc') });
|
|
40
|
-
this.sortService.onLocalSortChanged(this.gridObj, this.gridOptions, this.dataviewObj, cols);
|
|
41
|
-
|
|
42
|
-
// update the this.gridObj sortColumns array which will at the same add the visual sort icon(s) on the UI
|
|
43
|
-
const newSortColumns: ColumnSort[] = cols.map((col) => {
|
|
44
|
-
return { columnId: col.sortCol.id, sortAsc: col.sortAsc };
|
|
45
|
-
});
|
|
46
|
-
this.gridObj.setSortColumns(newSortColumns); // add sort icon in UI
|
|
47
|
-
} else {
|
|
48
|
-
alert('Command: ' + args.command);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
```
|
|
54
|
-
#### Callback Hooks
|
|
55
|
-
There are 2 callback hooks which are accessible in the Grid Options
|
|
56
|
-
- `onBeforeMenuShow`
|
|
57
|
-
- `onCommand`
|
|
58
|
-
|
|
59
|
-
For more info on all the available properties of the custom commands, you can read refer to the doc written in the Grid Menu [implementation](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/extensions/slickHeaderButtons.ts) itself.
|
|
60
|
-
|
|
61
|
-
### How to change icon(s) of the default commands?
|
|
62
|
-
You can change any of the default command icon(s) by changing the `icon[X-command]`, for example, see below for the defaults.
|
|
63
|
-
```ts
|
|
64
|
-
this.gridOptions = {
|
|
65
|
-
enableHeaderMenu: true,
|
|
66
|
-
headerMenu: {
|
|
67
|
-
iconColumnHideCommand: 'mdi mdi-close'
|
|
68
|
-
iconSortAscCommand: 'mdi mdi-sort-ascending'
|
|
69
|
-
iconSortDescCommand: 'mdi mdi-sort-descending',
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
```
|
|
73
|
-
### How to Disable the Header Menu?
|
|
74
|
-
You can disable the Header Menu, by calling `enableHeaderMenu: false` from the Grid Options.
|
|
75
|
-
```ts
|
|
76
|
-
this.gridOptions = {
|
|
77
|
-
enableHeaderMenu: false
|
|
78
|
-
};
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### How to Exclude Header Menu from a Particular Column?
|
|
82
|
-
You can exclude a column from getting a Header Menu by calling `excludeFromHeaderMenu` in your Column Definition. For example, we don't need it on a column that has an edit icon:
|
|
83
|
-
|
|
84
|
-
```ts
|
|
85
|
-
this.columnDefinitions = [
|
|
86
|
-
{ id: 'edit', formatter: Formatters.editIcon, excludeFromHeaderMenu: true, excludeFromExport: true },
|
|
87
|
-
{ id: 'title', name: 'Title', field: 'title', sortable: true },
|
|
88
|
-
{ id: 'duration', name: 'Duration (days)', field: 'duration', sortable: true },
|
|
89
|
-
];
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Sample
|
|
93
|
-
You can add Header Menu to 1 column or all columns like shown below. You can also add sub-menus by nesting `commandItems`
|
|
94
|
-
|
|
95
|
-
```ts
|
|
96
|
-
// add custom Header Menu to all columns except "Action"
|
|
97
|
-
this.columnDefinitions.forEach(col => {
|
|
98
|
-
col.header = {
|
|
99
|
-
menu: {
|
|
100
|
-
commandItems: [
|
|
101
|
-
{ command: 'sort-ascending', title: 'Sort Ascending' },
|
|
102
|
-
{ command: 'sort-descending', title: 'Sort Descending' },
|
|
103
|
-
'divider',
|
|
104
|
-
{
|
|
105
|
-
// we can also have multiple nested sub-menus
|
|
106
|
-
command: 'custom-actions', title: 'Hello', positionOrder: 99,
|
|
107
|
-
commandItems: [
|
|
108
|
-
{ command: 'hello-world', title: 'Hello World' },
|
|
109
|
-
{ command: 'hello-slickgrid', title: 'Hello SlickGrid' },
|
|
110
|
-
{
|
|
111
|
-
command: 'sub-menu', title: `Let's play`, cssClass: 'green', subMenuTitle: 'choose your game', subMenuTitleCssClass: 'text-italic salmon',
|
|
112
|
-
commandItems: [
|
|
113
|
-
{ command: 'sport-badminton', title: 'Badminton' },
|
|
114
|
-
{ command: 'sport-tennis', title: 'Tennis' },
|
|
115
|
-
{ command: 'sport-racquetball', title: 'Racquetball' },
|
|
116
|
-
{ command: 'sport-squash', title: 'Squash' },
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
]
|
|
120
|
-
}
|
|
121
|
-
]
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
});
|
|
125
|
-
```
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
##### index
|
|
2
|
-
- [Usage Demo](#usage)
|
|
3
|
-
- [Resize by Content - Grid Options](#resize-by-content---grid-options)
|
|
4
|
-
- [Resize by Content - Column Options](#resize-by-content---column-options)
|
|
5
|
-
|
|
6
|
-
### Demo
|
|
7
|
-
[Demo](https://ghiscoding.github.io/Angular-Slickgrid/#/resize-by-content) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-resize-by-content.component.ts)
|
|
8
|
-
|
|
9
|
-
### Description
|
|
10
|
-
The default of Slickgrid-Universal is to fit all columns in the container viewport and for the most part that is a good resize to use and it's fast. However if your grid has a lot of columns then doing a fit to viewport is not exactly great, you have lot of columns a few of these columns will become too small (we strongly suggest adding `minWidth` to every column) and you'll start seeing ellipsis to a few of these columns.
|
|
11
|
-
|
|
12
|
-
The Auto-Resize by Cell Content will fix the problem described in previous paragraph, however it will come with a cost. It will read through all the cell content of all your items (because this could slow down the grid a lot, there's a default to not go over a 1000 rows but that could be overridden if you wish). For that reason the **resize by cell content** is an **opt-in** feature.
|
|
13
|
-
|
|
14
|
-
How does it work? It loop through the dataset and try to calculate the best possible width, it does so by assuming a few things. For example we assume the a character is by default 7 pixels wide (via `resizeCellCharWidthInPx`), we also assume that not every data will be the same width for example string type might be a little less wide (with chars like "i", "l", "j" are thinner) compare to numbers which are always the same width and so have some ratio option for that (via `resizeDefaultRatioForStringType` and `resizeCalcWidthRatio`).
|
|
15
|
-
|
|
16
|
-
There are a few configuration options you can use
|
|
17
|
-
- ratio (`resizeDefaultRatioForStringType` and `resizeCalcWidthRatio`)
|
|
18
|
-
- extra padding (`resizeExtraWidthPadding`)
|
|
19
|
-
- char width
|
|
20
|
-
- padding (`resizeCellPaddingWidthInPx`, `resizeFormatterPaddingWidthInPx`, `resizeExtraWidthPadding`)
|
|
21
|
-
- max width threshold (`resizeMaxWidthThreshold`)
|
|
22
|
-
... and more
|
|
23
|
-
|
|
24
|
-
### Usage
|
|
25
|
-
|
|
26
|
-
```ts
|
|
27
|
-
defineGrid() {
|
|
28
|
-
this.columnDefinitions = [
|
|
29
|
-
{ id: 'action', field: 'action', name: 'Action', width: 50, maxWidth: 50 },
|
|
30
|
-
{ id: 'firstName', field: 'firstName', name: 'First Name', mindWidth: 100 },
|
|
31
|
-
{ id: 'lastName', field: 'lastName', name: 'First Name', mindWidth: 100, resizeExtraWidthPadding: 10 },
|
|
32
|
-
// ...
|
|
33
|
-
];
|
|
34
|
-
|
|
35
|
-
this.gridOptions = {
|
|
36
|
-
// ...
|
|
37
|
-
enableAutoResize: true,
|
|
38
|
-
|
|
39
|
-
// resizing by cell content is opt-in
|
|
40
|
-
// we first need to disable the 2 default flags to disable autoFit/autosize
|
|
41
|
-
autoFitColumnsOnFirstLoad: false,
|
|
42
|
-
enableAutoSizeColumns: false,
|
|
43
|
-
|
|
44
|
-
// then enable resize by content with these 2 flags
|
|
45
|
-
autosizeColumnsByCellContentOnFirstLoad: true,
|
|
46
|
-
enableAutoResizeColumnsByCellContent: true,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Resize by Content - Grid Options
|
|
52
|
-
There a few grid options that you can change to override the default resize options. We listed the grid options below for the resize and they should all be there but just in case, you should also check the [GridOption](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/interfaces/gridOption.interface.ts) and [ResizeByContentOption](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/interfaces/resizeByContentOption.interface.ts) interface.
|
|
53
|
-
|
|
54
|
-
```ts
|
|
55
|
-
export interface GridOption {
|
|
56
|
-
//...
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* defaults to true, do we want to resize the grid by content only on the first page or anytime the data changes?
|
|
60
|
-
* Requires `enableAutoResizeColumnsByCellContent` to be set.
|
|
61
|
-
* Also don't get confused with `autosizeColumnsByCellContentOnFirstLoad` that flag won't block resize by content after the first load while `resizeByContentOnlyOnFirstLoad`
|
|
62
|
-
*/
|
|
63
|
-
resizeByContentOnlyOnFirstLoad?: boolean;
|
|
64
|
-
|
|
65
|
-
/** Resize by Content multiple options */
|
|
66
|
-
resizeByContentOptions?: ResizeByContentOption;
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
and
|
|
70
|
-
|
|
71
|
-
```ts
|
|
72
|
-
export interface ResizeByContentOption {
|
|
73
|
-
/** defaults to false, if a column `width` is provided (or was previously calculated) should we recalculate it or not when resizing by cell content? */
|
|
74
|
-
alwaysRecalculateColumnWidth?: boolean;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Defaults to 7, width in pixels of a string character which is used by the resize columns by its content, this can vary depending on which font family/size is used & cell padding.
|
|
78
|
-
* This is only used when resizing the columns width by their content, we need to know the width of a character in pixel to do all calculations.
|
|
79
|
-
* Requires `enableAutoResizeColumnsByCellContent` to be set.
|
|
80
|
-
*/
|
|
81
|
-
cellCharWidthInPx?: number;
|
|
82
|
-
|
|
83
|
-
/** Defaults to 6, cell padding width to add to the calculation when resizing columns by their cell text content (requires `enableAutoResizeColumnsByCellContent` to be set) */
|
|
84
|
-
cellPaddingWidthInPx?: number;
|
|
85
|
-
|
|
86
|
-
/** Defaults to around ~0.9, what is the ratio to use (on field `type` "string" only) in the calculation when resizing columns by their cell text content (requires `enableAutoResizeColumnsByCellContent` to be set). */
|
|
87
|
-
defaultRatioForStringType?: number;
|
|
88
|
-
|
|
89
|
-
/** Defaults to 6, padding width to add to the calculation when using a Formatter and resizing columns by their cell text content (requires `enableAutoResizeColumnsByCellContent` to be set). */
|
|
90
|
-
formatterPaddingWidthInPx?: number;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Defaults to 1000, how many rows are we going to inspect cell content width?
|
|
94
|
-
* This is use when calculating all column width by their cell content, it requires `enableAutoResizeColumnsByCellContent` to be set.
|
|
95
|
-
*/
|
|
96
|
-
maxItemToInspectCellContentWidth?: number;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Defaults to 5000, how many rows (of a single column) are we going to inspect cell content width?
|
|
100
|
-
* This is use when calculating column width by their cell content when calling "Resize by Content" (from header menu and/or double-click to resize single column)
|
|
101
|
-
*/
|
|
102
|
-
maxItemToInspectSingleColumnWidthByContent?: number;
|
|
103
|
-
|
|
104
|
-
/** Defaults to 50, what width to remove from new column width when the grid is a frozen (pinned) grid and its column width exceeds the viewport full width. */
|
|
105
|
-
widthToRemoveFromExceededWidthReadjustment?: number;
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Resize by Content - Column Options
|
|
110
|
-
We listed the column definition options below for the resize and they should all be there but just in case, you should also check the [Column](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/interfaces/column.interface.ts) interface.
|
|
111
|
-
|
|
112
|
-
```ts
|
|
113
|
-
export interface Column {
|
|
114
|
-
/** defaults to false, if a column `width` is provided (or was previously calculated) should we recalculate it or not when resizing by cell content? */
|
|
115
|
-
resizeAlwaysRecalculateWidth?: boolean;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Defaults to 1, a column width ratio to use in the calculation when resizing columns by their cell content.
|
|
119
|
-
* We have this ratio number so that if we know that the cell content has lots of thin character (like 1, i, t, ...) we can lower the ratio to take up less space.
|
|
120
|
-
* In other words and depending on which font family you use, each character will have different width, characters like (i, t, 1) takes a lot less space compare to (W, H, Q),
|
|
121
|
-
* unless of course we use a monospace font family which will have the exact same size for each characters and in that case we leave it to 1 but that rarely happens.
|
|
122
|
-
* NOTE: the default ratio is 1, except for string where we use a ratio of around ~0.9 since we have more various thinner characters like (i, l, t, ...).
|
|
123
|
-
*/
|
|
124
|
-
resizeCalcWidthRatio?: number;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* no defaults, a character width to use when resizing columns by their cell content.
|
|
128
|
-
* If nothing is provided it will use `resizeCellCharWidthInPx` defined in the grid options.
|
|
129
|
-
*/
|
|
130
|
-
resizeCharWidthInPx?: number;
|
|
131
|
-
|
|
132
|
-
/** no defaults, what is the column max width threshold to not go over when resizing columns by their cell content */
|
|
133
|
-
resizeMaxWidthThreshold?: number;
|
|
134
|
-
|
|
135
|
-
/** no defaults, what is optional extra width padding to add to the calculation when resizing columns by their cell content */
|
|
136
|
-
resizeExtraWidthPadding?: number;
|
|
137
|
-
}
|
|
138
|
-
```
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
#### index
|
|
2
|
-
- [Single Row Selection](#single-row-selection)
|
|
3
|
-
- [Multiple Row Selections](#multiple-row-selections)
|
|
4
|
-
- [Change Dynamically Single/Multiple Selections](#changing-dynamically-from-single-to-multiple-selections-and-vice-versa)
|
|
5
|
-
- [Mixing Single & Multiple Row Selections](#mixing-single--multiple-row-selections)
|
|
6
|
-
- [Disable Custom Rows Selections via `selectableOverride`](#disable-custom-rows-selections-via-selectableoverride)
|
|
7
|
-
- [Disable External Button when having Empty Selection](#disable-external-button-when-having-empty-selection)
|
|
8
|
-
- [Change Row Selections](#change-row-selections)
|
|
9
|
-
- Troubleshooting
|
|
10
|
-
- [Adding a Column dynamically is removing the Row Selection, why is that?](#adding-a-column-dynamically-is-removing-the-row-selection-why-is-that)
|
|
11
|
-
|
|
12
|
-
### Description
|
|
13
|
-
For row selection, you can simply play with couple of grid options (see below) and subscribe to `onSelectedRowsChanged` (a SlickGrid Event that is, it's not an Observable). However please note that `onSelectedRowsChanged` is a function available on the `Grid` object and you will need bind to `(gridChanged)` to get the object when grid is ready. There are 2 types of row selection(s) which you can do.
|
|
14
|
-
|
|
15
|
-
**Note:** `enableCheckboxSelector` and `enableExcelCopyBuffer` do not work well together, this is because they both share the same `Row.SelectionModel` and one cancels the other. It is recommended to not use `enableExcelCopyBuffer` in that case.
|
|
16
|
-
|
|
17
|
-
### Demo
|
|
18
|
-
[Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/selection) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-rowselection.component.ts)
|
|
19
|
-
|
|
20
|
-
## Single Row Selection
|
|
21
|
-
For a single row selection, you need to have `enableCellNavigation: true`, `enableRowSelection: true` and `multiSelect: false` and as described earlier, subscribe to `onSelectedRowsChanged` (for that you need to bind to `(gridChanged)`).
|
|
22
|
-
|
|
23
|
-
**Note:** if you want to change from Multiple Selections to Single Selection (and vice-versa), you could use the grid options `enableCellNavigation` flag, however this is not possible when using Inline Editors since this flag is required. However, there is no other known ways of toggling dynamically.
|
|
24
|
-
|
|
25
|
-
#### View
|
|
26
|
-
```html
|
|
27
|
-
<angular-slickgrid gridId="grid4"
|
|
28
|
-
[columns]="columnDefinitions"
|
|
29
|
-
[options]="gridOptions"
|
|
30
|
-
[dataset]="dataset"
|
|
31
|
-
(onSelectedRowsChanged)="onSelectedRowsChanged($event.detail.eventData, $event.detail.args)">
|
|
32
|
-
</angular-slickgrid>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
#### Component
|
|
36
|
-
```ts
|
|
37
|
-
this.gridOptions = {
|
|
38
|
-
enableAutoResize: true,
|
|
39
|
-
enableCellNavigation: true,
|
|
40
|
-
enableCheckboxSelector: true,
|
|
41
|
-
enableRowSelection: true,
|
|
42
|
-
multiSelect: false,
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
onSelectedRowsChanged(e, args) {
|
|
46
|
-
if (Array.isArray(args.rows)) {
|
|
47
|
-
this.selectedObjects = args.rows.map(idx => {
|
|
48
|
-
const item = grid.getDataItem(idx);
|
|
49
|
-
return item.title || '';
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Multiple Row Selections
|
|
56
|
-
As for multiple row selections, you need to provide an extra grid option of `rowSelectionOptions` which is an object and within it, you need to disable the `selectActiveRow` flag. The other configurations are the same as a Single Selection, which is to enable `enableCheckboxSelector` and `enableRowSelection`. Then as describe earlier, you will subscribe to `onSelectedRowsChanged` (for that you need to bind to `(gridChanged)`).
|
|
57
|
-
|
|
58
|
-
#### View
|
|
59
|
-
```html
|
|
60
|
-
<angular-slickgrid gridId="grid4"
|
|
61
|
-
[columns]="columnDefinitions"
|
|
62
|
-
[options]="gridOptions"
|
|
63
|
-
[dataset]="dataset"
|
|
64
|
-
(onSelectedRowsChanged)="onSelectedRowsChanged($event.detail.eventData, $event.detail.args)">
|
|
65
|
-
</angular-slickgrid>
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
#### Component
|
|
69
|
-
```typescript
|
|
70
|
-
export class Example1 implements OnInit {
|
|
71
|
-
ngOnInit() {
|
|
72
|
-
this.gridOptions = {
|
|
73
|
-
enableAutoResize: true,
|
|
74
|
-
enableCellNavigation: true,
|
|
75
|
-
enableCheckboxSelector: true,
|
|
76
|
-
enableRowSelection: true,
|
|
77
|
-
rowSelectionOptions: {
|
|
78
|
-
// True (Single Selection), False (Multiple Selections)
|
|
79
|
-
selectActiveRow: false
|
|
80
|
-
},
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
onSelectedRowsChanged(e, args) {
|
|
85
|
-
if (Array.isArray(args.rows)) {
|
|
86
|
-
// user clicked on the 1st column, multiple checkbox selection
|
|
87
|
-
console.log('multiple row checkbox selected', event, args);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
```
|
|
91
|
-
## Changing Dynamically from Single to Multiple Selections (and vice-versa)
|
|
92
|
-
If you want to change from Multiple Selections to Single Selection (and vice-versa), you could toggle the grid options `enableCellNavigation` flag (`False` when you want Single Selection), however this is not possible when using Inline Editors since this flag is required. Note that there is currently no other ways of toggling dynamically without re-creating the grid.
|
|
93
|
-
|
|
94
|
-
## Mixing Single & Multiple Row Selections
|
|
95
|
-
SlickGrid is so powerful and customizable, you could if you wish mix the multiple row selections (cell column 1) and single row selection (any other cell click). For that though, you will need to use 2 SlickGrid Events (`onClick` and `onSelectedRowsChanged`). For example we can do it this way:
|
|
96
|
-
|
|
97
|
-
#### View
|
|
98
|
-
```html
|
|
99
|
-
<angular-slickgrid gridId="grid4"
|
|
100
|
-
[columns]="columnDefinitions"
|
|
101
|
-
[options]="gridOptions"
|
|
102
|
-
[dataset]="dataset"
|
|
103
|
-
(onSelectedRowsChanged)="onSelectedRowsChanged($event.detail.eventData, $event.detail.args)"
|
|
104
|
-
(onClick)="onCellClicked($event.detail.eventData, $event.detail.args)">
|
|
105
|
-
</angular-slickgrid>
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
#### Component
|
|
109
|
-
```typescript
|
|
110
|
-
export class Example1 implements OnInit {
|
|
111
|
-
onSelectedRowsChanged(e, args) {
|
|
112
|
-
// user clicked on the 1st column, multiple checkbox selection
|
|
113
|
-
console.log('multiple row checkbox selected', event, args);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
onCellClicked(e, args) {
|
|
117
|
-
// when clicking on any cell, we will make it the new selected row
|
|
118
|
-
// however, we don't want to interfere with multiple row selection checkbox which is on 1st column cell
|
|
119
|
-
if (args.cell !== 0) {
|
|
120
|
-
grid.setSelectedRows([args.row]);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Disable Custom Rows Selections via `selectableOverride`
|
|
127
|
-
You can use `selectableOverride` to provide custom logic to disable certain rows selections, for example the code below will remove the row selection on every second row.
|
|
128
|
-
|
|
129
|
-
#### Component
|
|
130
|
-
```typescript
|
|
131
|
-
export class Example1 implements OnInit {
|
|
132
|
-
prepareGrid() {
|
|
133
|
-
this.gridOptions = {
|
|
134
|
-
enableRowSelection: true,
|
|
135
|
-
enableCheckboxSelector: true,
|
|
136
|
-
checkboxSelector: {
|
|
137
|
-
// you can override the logic for showing (or not) the expand icon
|
|
138
|
-
// for example, display the expand icon only on every 2nd row
|
|
139
|
-
selectableOverride: (row: number, dataContext: any, grid: any) => (dataContext.id % 2 === 1)
|
|
140
|
-
},
|
|
141
|
-
multiSelect: false,
|
|
142
|
-
rowSelectionOptions: {
|
|
143
|
-
// True (Single Selection), False (Multiple Selections)
|
|
144
|
-
selectActiveRow: true,
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Disable External Button when having Empty Selection
|
|
152
|
-
When having an external button that you want to work only when there's row selection, there are 2 ways of doing this.
|
|
153
|
-
1. use the `onSelectedRowsChanged` event (via your View in HTML or via ViewModel)
|
|
154
|
-
```html
|
|
155
|
-
<button disabled.bind="isMyButtonDisabled">My Button</button>
|
|
156
|
-
<angular-slickgrid gridId="grid2"
|
|
157
|
-
[columns]="columnDefinitions"
|
|
158
|
-
[options]="gridOptions"
|
|
159
|
-
[dataset]="dataset"
|
|
160
|
-
(onSelectedRowsChanged)="handleOnSelectedRowsChanged($event.detail.args)">
|
|
161
|
-
</angular-slickgrid>
|
|
162
|
-
```
|
|
163
|
-
```ts
|
|
164
|
-
isMyButtonDisabled = false;
|
|
165
|
-
|
|
166
|
-
handleOnSelectedRowsChanged(args) {
|
|
167
|
-
this.isMyButtonDisabled = args?.rows?.length === 0;
|
|
168
|
-
}
|
|
169
|
-
```
|
|
170
|
-
2. use the `onGridStateChanged` event (see [Grid State & Presets](Grid-State-&-Preset.md) Wiki)
|
|
171
|
-
```html
|
|
172
|
-
<button disabled.bind="isMyButtonDisabled">My Button</button>
|
|
173
|
-
<angular-slickgrid gridId="grid2"
|
|
174
|
-
[columns]="columnDefinitions"
|
|
175
|
-
[options]="gridOptions"
|
|
176
|
-
[dataset]="dataset"
|
|
177
|
-
(onGridStateChanged)="handleOngridStateChanged($event.detail.args)">
|
|
178
|
-
</angular-slickgrid>
|
|
179
|
-
```
|
|
180
|
-
```ts
|
|
181
|
-
isMyButtonDisabled = false;
|
|
182
|
-
|
|
183
|
-
handleOngridStateChanged(gridState) {
|
|
184
|
-
if (Array.isArray(gridState?.rowSelection.dataContextIds)) {
|
|
185
|
-
this.isMassSelectionDisabled = gridState.rowSelection.dataContextIds.length === 0;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### Change Row Selections
|
|
191
|
-
You can change which row(s) are selected by using the built-in SlickGrid method `setSelectedRows(rowIndexes)` (passing an empty array will clear all selection), however please note that it requires an array of row indexes as you see them in the UI and it won't work that great with Pagination (if that is what you are looking for then take a look at this Stack Overflow [Q&A](https://stackoverflow.com/questions/59629565/want-to-change-gridoption-preselectedrows-row-in-angular-slickgrid-dynamically-o))
|
|
192
|
-
|
|
193
|
-
```html
|
|
194
|
-
<angular-slickgrid gridId="grid2"
|
|
195
|
-
[columns]="columnDefinitions"
|
|
196
|
-
[options]="gridOptions"
|
|
197
|
-
[dataset]="dataset"
|
|
198
|
-
(onAngularGridCreated)="angularGridReady($event.detail)">
|
|
199
|
-
</angular-slickgrid>
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
```ts
|
|
203
|
-
export class Example1 {
|
|
204
|
-
angularGrid: AngularGridInstance;
|
|
205
|
-
|
|
206
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
207
|
-
this.angularGrid = angularGrid;
|
|
208
|
-
this.gridObj = angularGrid.slickGrid;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
changeRowSelections() {
|
|
212
|
-
this.angularGrid.slickGrid.setSelectedRows(rowIndexes);
|
|
213
|
-
|
|
214
|
-
// OR providing an empty array will clear the row selection
|
|
215
|
-
// this.angularGrid.slickGrid.setSelectedRows([]);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
## Troubleshooting
|
|
221
|
-
### Adding a Column dynamically is removing the Row Selection, why is that?
|
|
222
|
-
The reason is because the Row Selection (checkbox) plugin is a special column and Angular-Slickgrid is adding an extra column dynamically for the Row Selection checkbox and that is **not** reflected in your local copy of `columnDefinitions`. To address this issue, you need to get the Angular-Slickgrid internal copy of all columns (including the extra columns), you can get it via `getAllColumnDefinitions()` from the Grid Service and then you can use to that array and that will work.
|
|
223
|
-
|
|
224
|
-
```html
|
|
225
|
-
<angular-slickgrid gridId="grid17"
|
|
226
|
-
[columns]="columnDefinitions"
|
|
227
|
-
[options]="gridOptions"
|
|
228
|
-
[dataset]="dataset"
|
|
229
|
-
(onAngularGridCreated)="angularGridReady($event.detail)">
|
|
230
|
-
</angular-slickgrid>
|
|
231
|
-
```
|
|
232
|
-
```ts
|
|
233
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
234
|
-
this.angularGrid = angularGrid;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
addNewColumn() {
|
|
238
|
-
const newColumn = { /*...*/ };
|
|
239
|
-
|
|
240
|
-
const allColumns = this.angularGrid.gridService.getAllColumnDefinitions();
|
|
241
|
-
allColumns.push(newColumn);
|
|
242
|
-
this.columnDefinitions = allColumns.slice(); // or use spread operator [...cols]
|
|
243
|
-
|
|
244
|
-
// you could also use SlickGrid setColumns() method
|
|
245
|
-
// this.angularGrid.slickGrid.setColumns(cols);
|
|
246
|
-
}
|
|
247
|
-
```
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
#### index
|
|
2
|
-
- [The action column](#the-action-column)
|
|
3
|
-
- [Multiple Row Selections](#multiple-row-selections)
|
|
4
|
-
- [Change Dynamically Single/Multiple Selections](#changing-dynamically-from-single-to-multiple-selections-and-vice-versa)
|
|
5
|
-
- [Mixing Single & Multiple Row Selections](#mixing-single--multiple-row-selections)
|
|
6
|
-
- [Disable Custom Rows Selections via `selectableOverride`](#disable-custom-rows-selections-via-selectableoverride)
|
|
7
|
-
- [Disable External Button when having Empty Selection](#disable-external-button-when-having-empty-selection)
|
|
8
|
-
- [Change Row Selections](#change-row-selections)
|
|
9
|
-
- Troubleshooting
|
|
10
|
-
- [Adding a Column dynamically is removing the Row Selection, why is that?](#adding-a-column-dynamically-is-removing-the-row-selection-why-is-that)
|
|
11
|
-
|
|
12
|
-
### Description
|
|
13
|
-
The Row based editing plugin makes it possible to keep the grid readonly except for rows which the user explicitely toggles into edit mode.
|
|
14
|
-
|
|
15
|
-
**Note:** This plugin enforces the use of the `autoEdit` option and will turn it on with a console warning if its not already.
|
|
16
|
-
|
|
17
|
-
### Demo
|
|
18
|
-
[Demo](https://ghiscoding.github.io/Angular-Slickgrid/#/base-row-editing) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-base-row-editing.component.ts)
|
|
19
|
-
|
|
20
|
-
## The action column
|
|
21
|
-
A new column is rendered that shows an edit/delete button. If the user clicks on edit, a save and cancel button are shown instead and the row toggles into edit mode. By default as the last column but you can override it with the option `columnIndexPosition`. Additionally it's default column id can be overriden using the opiton `columnId`. Furthermore, you can also override the columns label via the `actionsColumnLabel` property.
|
|
22
|
-
|
|
23
|
-
### Single or multiple editable rows
|
|
24
|
-
By default you can only toggle a single row into edit mode. If you set the option `allowMultipleRows` to `true` on the other hand, you can toggle as many as you want.
|
|
25
|
-
|
|
26
|
-
### Configuring the action buttons
|
|
27
|
-
You can override the styling, the hover text as well as whether a prompt — and with what text — should be shown. It is done by overriding the `actionButtons` property of the [plugins options](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/interfaces/rowBasedEditOption.interface.ts).
|
|
28
|
-
|
|
29
|
-
## Support for the Excel Copy Buffer Plugin
|
|
30
|
-
If the [Excel Copy Buffer Plugin](excel-copy-buffer.md) is configured, the Row based editing pluging will override it's behavior by denying pastes on all cells not within a edit mode row. Nevertheless, any existing `BeforePasteCellHandler` will be respected.
|
|
31
|
-
|
|
32
|
-
## How the plugin works
|
|
33
|
-
The idea of the plugin is to focus the users editing experience on specific individual rows and and save them individually. This is achieved by letting the user toggle one or more rows into edit mode.
|
|
34
|
-
When a that happens a potentially registered `onBeforeEditMode` callback is executed to handle various preparation or cleanup tasks. Now changes can be made to those rows and will be highlighted and tracked. The user may cancel the edit mode at any time and revert all cells changes. If the save button is pressed on the other hand an `onBeforeRowUpdated` hook, which you define via plugin options, is called and expects a `Promise<boolean>`. In that method you'd typically write the changes to your backend and return either true or false based on the operations outcome. If a negative boolean is returned the edit mode is kept, otherwise the row applies the changes and toggles back into readonly mode. That means, no modifications can be done on the grid.
|
|
35
|
-
|
|
36
|
-
Here's the respective code shown in Example22:
|
|
37
|
-
|
|
38
|
-
#### ViewModel
|
|
39
|
-
```ts
|
|
40
|
-
onBeforeRowUpdated(args) {
|
|
41
|
-
const { effortDriven, percentComplete, finish, start, duration, title } = args.dataContext;
|
|
42
|
-
|
|
43
|
-
if (duration > 40) {
|
|
44
|
-
alert('Sorry, 40 is the maximum allowed duration.');
|
|
45
|
-
return Promise.resolve(false);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return fakeFetch('your-backend-api/endpoint', {
|
|
49
|
-
method: 'POST',
|
|
50
|
-
body: JSON.stringify({ effortDriven, percentComplete, finish, start, duration, title }),
|
|
51
|
-
headers: {
|
|
52
|
-
'Content-type': 'application/json; charset=UTF-8'
|
|
53
|
-
}
|
|
54
|
-
}).catch(err => {
|
|
55
|
-
console.error(err);
|
|
56
|
-
return false;
|
|
57
|
-
})
|
|
58
|
-
.then(response => {
|
|
59
|
-
if (response === false) { // <---- the negative response, e.g validation failed, keep the row as is
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
if (typeof response === 'object') {
|
|
63
|
-
return response!.json();
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
|
-
.then(json => {
|
|
67
|
-
alert(json.message);
|
|
68
|
-
return true; // <--- all good, apply changes in grid and toggle row into readonly mode
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
|
-
```
|