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,226 +0,0 @@
|
|
|
1
|
-
#### index
|
|
2
|
-
- [Default Usage](#default-usage)
|
|
3
|
-
- [Action Callback Methods](#action-callback-methods)
|
|
4
|
-
- [Override Callback Methods](#override-callback-methods)
|
|
5
|
-
- [How to add Translations](#how-to-add-translations)
|
|
6
|
-
- [Default Internal Commands](#default-internal-commands)
|
|
7
|
-
- [Show only over Certain Columns](https://github.com#show-menu-only-over-certain-columns)
|
|
8
|
-
- [How to Disable Context Menu](#how-to-disable-the-context-menu)
|
|
9
|
-
- [UI Sample](#ui-sample)
|
|
10
|
-
|
|
11
|
-
### Demo
|
|
12
|
-
|
|
13
|
-
#### Context Menu with Grouping
|
|
14
|
-
[Context Menu Demo](https://ghiscoding.github.io/Angular-Slickgrid/#/context) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-contextmenu.component.ts)
|
|
15
|
-
|
|
16
|
-
[Grouping Demo](https://ghiscoding.github.io/Angular-Slickgrid/#/grouping) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-grouping.component.ts)
|
|
17
|
-
|
|
18
|
-
### Description
|
|
19
|
-
A Context Menu is triggered by a mouse right+click and can show a list of Commands (to execute an action) and/or Options (to change the value of a field). The lib comes with a default list of custom commands (copy cell, export & grouping commands). Also note that the Commands list is following the same structure used in the [Cell Menu](../column-functionalities/Cell-Menu.md), [Header Menu](Header-Menu-&-Header-Buttons.md) & [Grid Menu](Grid-Menu.md). Very similar to the [Cell Menu](../column-functionalities/Cell-Menu.md), they were both created as SlickGrid plugins during the same period, their main difference is that they get triggered differently (mouse right+click vs cell click) and they serve different purposes. The Cell Menu is more oriented on a row action (e.g. delete current row) while the Context Menu is all about actions for the entire grid (e.g. export to Excel).
|
|
20
|
-
|
|
21
|
-
This extensions is wrapped around the new SlickGrid Plugin **SlickContextMenu**
|
|
22
|
-
|
|
23
|
-
### Default Usage
|
|
24
|
-
Technically, the Context Menu is enabled by default (copy, export) and so you don't have anything to do to enjoy it (you could disable it at any time). However, if you want to customize the content of the Context Menu, then continue reading. You can customize the menu with 2 different lists, Commands and/or Options, they can be used separately or at the same time. Also note that even though the code shown below makes a separation between the Commands and Options, you can mix them in the same Context Menu.
|
|
25
|
-
|
|
26
|
-
#### with Commands
|
|
27
|
-
|
|
28
|
-
```ts
|
|
29
|
-
this.gridOptions = {
|
|
30
|
-
enableFiltering: true,
|
|
31
|
-
enableContextMenu: true, // enabled by default
|
|
32
|
-
contextMenu: {
|
|
33
|
-
hideCloseButton: false,
|
|
34
|
-
commandTitle: 'Commands', // optional, add title
|
|
35
|
-
commandItems: [
|
|
36
|
-
'divider',
|
|
37
|
-
{ divider: true, command: '', positionOrder: 60 },
|
|
38
|
-
{
|
|
39
|
-
command: 'command1', title: 'Command 1', positionOrder: 61,
|
|
40
|
-
// you can use the "action" callback and/or use "onCommand" callback from the grid options, they both have the same arguments
|
|
41
|
-
action: (e, args) => {
|
|
42
|
-
console.log(args.dataContext, args.column); // action callback.. do something
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
{ command: 'help', title: 'HELP', iconCssClass: 'mdi mdi-help-circle', positionOrder: 62 },
|
|
46
|
-
// you can add sub-menus by adding nested `commandItems`
|
|
47
|
-
{
|
|
48
|
-
// we can also have multiple nested sub-menus
|
|
49
|
-
command: 'export', title: 'Exports', positionOrder: 99,
|
|
50
|
-
commandItems: [
|
|
51
|
-
{ command: 'exports-txt', title: 'Text (tab delimited)' },
|
|
52
|
-
{
|
|
53
|
-
command: 'sub-menu', title: 'Excel', cssClass: 'green', subMenuTitle: 'available formats', subMenuTitleCssClass: 'text-italic orange',
|
|
54
|
-
commandItems: [
|
|
55
|
-
{ command: 'exports-csv', title: 'Excel (csv)' },
|
|
56
|
-
{ command: 'exports-xlsx', title: 'Excel (xlsx)' },
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
#### with Options
|
|
67
|
-
That is when you want to define a list of Options (only 1 list) that the user can choose from and once is selected we would do something (for example change the value of a cell in the grid).
|
|
68
|
-
|
|
69
|
-
```ts
|
|
70
|
-
this.gridOptions = {
|
|
71
|
-
contextMenu: {
|
|
72
|
-
hideCloseButton: false,
|
|
73
|
-
optionTitle: 'Change Effort Driven Flag', // optional, add title
|
|
74
|
-
optionItems: [
|
|
75
|
-
{ option: true, title: 'True', iconCssClass: 'mdi mdi-check-box-outline' },
|
|
76
|
-
{ option: false, title: 'False', iconCssClass: 'mdi mdi-checkbox-blank-outline' },
|
|
77
|
-
{ divider: true, command: '', positionOrder: 60 },
|
|
78
|
-
],
|
|
79
|
-
// subscribe to Context Menu onOptionSelected event (or use the "action" callback on each option)
|
|
80
|
-
onOptionSelected: (e, args) => {
|
|
81
|
-
// change Priority
|
|
82
|
-
const dataContext = args && args.dataContext;
|
|
83
|
-
if (dataContext && dataContext.hasOwnProperty('priority')) {
|
|
84
|
-
dataContext.priority = args.item.option;
|
|
85
|
-
this.sgb.gridService.updateItem(dataContext);
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Action Callback Methods
|
|
93
|
-
There are 2 ways to execute an action after a Command is clicked (or an Option is selected), you could do it via the `action` callback or via the `onCommand` callback. You might be wondering why 2 and what's the difference? Well the `action` would have to be defined on every single Command/Option while the `onCommand` (or `onOptionSelected`) is more of a global subscriber which gets triggered every time any of the Command/Option is clicked/selected, so for that, you would typically need to use `if/else` or a `switch/case`... hmm ok but I still don't understand when would I use the `onCommand`? Let say you combine the Context Menu with the (Action) [Cell Menu](Cell-Menu.md) and some of the commands are the same, well, in that case, it might be better to use the `onCommand` and centralize your commands in that callback, while in most other cases if you wish to do only 1 thing with a command, then using the `action` might be better. Also, note that they could also both be used at the same time if you wish.
|
|
94
|
-
|
|
95
|
-
So if you decide to use the `action` callback, then your code would look like this
|
|
96
|
-
##### with `action` callback
|
|
97
|
-
|
|
98
|
-
```ts
|
|
99
|
-
contextMenu: {
|
|
100
|
-
commandItems: [
|
|
101
|
-
{ command: 'command1', title: 'Command 1', action: (e, args) => console.log(args) }
|
|
102
|
-
{ command: 'command2', title: 'Command 2', action: (e, args) => console.log(args) }
|
|
103
|
-
// ...
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
##### with `onCommand` callback
|
|
109
|
-
```ts
|
|
110
|
-
contextMenu: {
|
|
111
|
-
commandItems: [
|
|
112
|
-
{ command: 'command1', title: 'Command 1' }
|
|
113
|
-
{ command: 'command2', title: 'Command 2' }
|
|
114
|
-
// ...
|
|
115
|
-
],
|
|
116
|
-
onCommand(e, args) => {
|
|
117
|
-
const columnDef = args.columnDef;
|
|
118
|
-
const command = args.command;
|
|
119
|
-
const dataContext = args.dataContext;
|
|
120
|
-
|
|
121
|
-
switch (command) {
|
|
122
|
-
case 'command1': alert('Command 1'); break;
|
|
123
|
-
case 'command2': alert('Command 2'); break;
|
|
124
|
-
default: break;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Override Callback Methods
|
|
131
|
-
What if you want to dynamically disable or hide a Command/Option or even disable the entire menu in certain circumstances? For these cases, you would use the override callback methods, the method must return a `boolean`. The list of override available are the following
|
|
132
|
-
- `menuUsabilityOverride` returning false would make the Context Menu unavailable to the user
|
|
133
|
-
- `itemVisibilityOverride` returning false would hide the item (command/option) from the list
|
|
134
|
-
- `itemUsabilityOverride` return false would disabled the item (command/option) from the list
|
|
135
|
-
- **note** there is also a `disabled` property that you could use, however it is defined at the beginning while the override is meant to be used with certain logic dynamically.
|
|
136
|
-
|
|
137
|
-
For example, say we want the Context Menu to only be available on the first 20 rows of the grid, we could use the override this way
|
|
138
|
-
|
|
139
|
-
```ts
|
|
140
|
-
contextMenu: {
|
|
141
|
-
menuUsabilityOverride: (args) => {
|
|
142
|
-
const dataContext = args && args.dataContext;
|
|
143
|
-
return (dataContext.id < 21); // say we want to display the menu only from Task 0 to 20
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
To give another example, with Options this time, we could say that we enable the `n/a` option only when the row is Completed. So we could do it this way
|
|
149
|
-
```ts
|
|
150
|
-
contextMenu: {
|
|
151
|
-
optionItems: [
|
|
152
|
-
{
|
|
153
|
-
option: 0, title: 'n/a', textCssClass: 'italic',
|
|
154
|
-
// only enable this option when the task is Not Completed
|
|
155
|
-
itemUsabilityOverride: (args) => {
|
|
156
|
-
const dataContext = args && args.dataContext;
|
|
157
|
-
return !dataContext.completed;
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
{ option: 1, iconCssClass: 'mdi mdi-star-outline yellow', title: 'Low' },
|
|
161
|
-
{ option: 2, iconCssClass: 'mdi mdi-star orange', title: 'Medium' },
|
|
162
|
-
{ option: 3, iconCssClass: 'mdi mdi-star red', title: 'High' },
|
|
163
|
-
]
|
|
164
|
-
}
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
### How to add Translations?
|
|
168
|
-
It works exactly like the rest of the library when `enableTranslate` is set, all we have to do is to provide translations with the `Key` suffix, so for example without translations, we would use `title` and that would become `titleKey` with translations, that;'s easy enough. So for example, a list of Options could be defined as follow:
|
|
169
|
-
```ts
|
|
170
|
-
contextMenu: {
|
|
171
|
-
optionTitleKey: 'COMMANDS', // optionally pass a title to show over the Options
|
|
172
|
-
optionItems: [
|
|
173
|
-
{ option: 1, titleKey: 'LOW', iconCssClass: 'mdi mdi-star-outline yellow' },
|
|
174
|
-
{ option: 2, titleKey: 'MEDIUM', iconCssClass: 'mdi mdi-star orange' },
|
|
175
|
-
{ option: 3, titleKey: 'HIGH', iconCssClass: 'mdi mdi-star red' },
|
|
176
|
-
]
|
|
177
|
-
}
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Show Menu only over Certain Columns
|
|
181
|
-
Say you want to show the Context Menu only when the user is over certain columns of the grid. For that, you could use the `commandShownOverColumnIds` (or `optionShownOverColumnIds`) array, by default these arrays are empty and when that is the case then the menu will be accessible from any columns. So if we want to have the Context Menu available only over the first 2 columns, we would have an array of those 2 column ids. For example, the following would show the Context Menu everywhere except the last 2 columns (priority, action) since they are not part of the array.
|
|
182
|
-
```ts
|
|
183
|
-
cellMenu: {
|
|
184
|
-
commandShownOverColumnIds: ['title', 'percentComplete', 'start', 'finish', 'completed'. /* 'priority', 'action' */],
|
|
185
|
-
}
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### Default Internal Commands
|
|
189
|
-
By defaults, the Context Menu will come with a few different preset Commands (copy, export). The Copy is straightforward, it allows you to copy the cell value, on the other hand, the export command(s) is dependent on the flags you have enabled in your Grid Options. For example, if you have only `enableExport` then you will get the `Export to CSV` and you might get as well `Export Tab-Delimited`, again that depends on which Grid Options you have enabled. Note that all internal commands have a `positionOrder` in the range of 50 to 60 (which is used to sort the Commands list), this allows you to append or prepend Commands to the list.
|
|
190
|
-
|
|
191
|
-
Another set of possible Commands would be related to Grouping, so if you are using Grouping in your grid then you will get 3 extra Commands (clear grouping, collapse groups, expand groups).
|
|
192
|
-
|
|
193
|
-
All of these internal commands, you can choose to hide them and/or change their icons, the default global options are the following and you can change any of them.
|
|
194
|
-
```ts
|
|
195
|
-
contextMenu: {
|
|
196
|
-
autoAdjustDrop: true,
|
|
197
|
-
autoAlignSide: true,
|
|
198
|
-
hideCloseButton: true,
|
|
199
|
-
hideClearAllGrouping: false,
|
|
200
|
-
hideCollapseAllGroups: false,
|
|
201
|
-
hideCommandSection: false,
|
|
202
|
-
hideCopyCellValueCommand: false,
|
|
203
|
-
hideExpandAllGroups: false,
|
|
204
|
-
hideExportCsvCommand: false,
|
|
205
|
-
hideExportExcelCommand: false,
|
|
206
|
-
hideExportTextDelimitedCommand: true,
|
|
207
|
-
hideMenuOnScroll: true,
|
|
208
|
-
hideOptionSection: false,
|
|
209
|
-
iconCopyCellValueCommand: 'mdi mdi-content-copy',
|
|
210
|
-
iconExportCsvCommand: 'mdi mdi-download',
|
|
211
|
-
iconExportExcelCommand: 'mdi mdi-file-excel-outline text-success',
|
|
212
|
-
iconExportTextDelimitedCommand: 'mdi mdi-download',
|
|
213
|
-
width: 200,
|
|
214
|
-
},
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
### How to Disable the Context Menu?
|
|
218
|
-
You can disable the Context Menu, by calling `enableContextMenu: false` from the Grid Options.
|
|
219
|
-
```typescript
|
|
220
|
-
this.gridOptions = {
|
|
221
|
-
enableContextMenu: false
|
|
222
|
-
};
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
### UI Sample
|
|
226
|
-

|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
### Description
|
|
2
|
-
You can use and show the Custom Footer with 2 left/right containers and will by default display filtered item count & total count on the right side. Also if it detects that you use row selection, it will also show the row selection count on the left footer side. You can also override both left/right side texts.
|
|
3
|
-
|
|
4
|
-
**NOTE:** The Custom Footer cannot be used in combination with Pagination, you can only show 1 or the other.
|
|
5
|
-
|
|
6
|
-
### Demo
|
|
7
|
-
[Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/formatter) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-formatter.component.ts)
|
|
8
|
-
|
|
9
|
-
### Usage
|
|
10
|
-
|
|
11
|
-
```ts
|
|
12
|
-
defineGrid() {
|
|
13
|
-
this.columnDefinitions = [ /*...*/ ];
|
|
14
|
-
|
|
15
|
-
this.gridOptions = {
|
|
16
|
-
// ...
|
|
17
|
-
showCustomFooter: true, // display some metrics in the bottom custom footer
|
|
18
|
-
customFooterOptions: {
|
|
19
|
-
// optionally display some text on the left footer container
|
|
20
|
-
leftFooterText: 'Grid created with <a href="https://github.com/ghiscoding/slickgrid-universal" target="_blank">Slickgrid-Universal</a>',
|
|
21
|
-
hideMetrics: false,
|
|
22
|
-
hideTotalItemCount: false,
|
|
23
|
-
hideLastUpdateTimestamp: false
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
#### CustomFooterOption Interface
|
|
30
|
-
Below is the list of all options available with the Custom Footer, you can visit the [customFooterOption.interface.ts](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/interfaces/customFooterOption.interface.ts) to see latest code in case the code below is not up to date.
|
|
31
|
-
```ts
|
|
32
|
-
export interface CustomFooterOption {
|
|
33
|
-
/** Optionally provide some text to be displayed on the left side of the footer (in the "left-footer" css class) */
|
|
34
|
-
leftFooterText?: string;
|
|
35
|
-
|
|
36
|
-
/** CSS class used for the left container */
|
|
37
|
-
leftContainerClass?: string;
|
|
38
|
-
|
|
39
|
-
/** Date format used when showing the "Last Update" timestamp in the metrics section. */
|
|
40
|
-
dateFormat?: string;
|
|
41
|
-
|
|
42
|
-
/** Defaults to 25, height of the Custom Footer in pixels, it could be a number (25) or a string ("25px") but it has to be in pixels. It will be used by the auto-resizer calculations. */
|
|
43
|
-
footerHeight?: number | string;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Defaults to false, which will hide the selected rows count on the bottom left of the footer.
|
|
47
|
-
* NOTE: if users defined a `leftFooterText`, then the selected rows count will NOT show up.
|
|
48
|
-
*/
|
|
49
|
-
hideRowSelectionCount?: boolean;
|
|
50
|
-
|
|
51
|
-
/** Defaults to false, do we want to hide the last update timestamp (endTime)? */
|
|
52
|
-
hideLastUpdateTimestamp?: boolean;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Defaults to false, do we want to hide the metrics (right section) when the footer is displayed?
|
|
56
|
-
* That could be used when we want to display only the left section with custom text
|
|
57
|
-
*/
|
|
58
|
-
hideMetrics?: boolean;
|
|
59
|
-
|
|
60
|
-
/** Defaults to false, do we want to hide the total item count of the entire dataset (the count exclude any filtered data) */
|
|
61
|
-
hideTotalItemCount?: boolean;
|
|
62
|
-
|
|
63
|
-
/** Defaults to "|", separator between the timestamp and the total count */
|
|
64
|
-
metricSeparator?: string;
|
|
65
|
-
|
|
66
|
-
/** Text shown in the custom footer on the far right for the metrics */
|
|
67
|
-
metricTexts?: MetricTexts;
|
|
68
|
-
|
|
69
|
-
/** CSS class used for the right container */
|
|
70
|
-
rightContainerClass?: string;
|
|
71
|
-
|
|
72
|
-
/** Optionally provide some text to be displayed on the right side of the footer (in the "right-footer" css class) */
|
|
73
|
-
rightFooterText?: string;
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
#### Screenshot Demo
|
|
78
|
-
Below is a print screen of the demo, you can see the full advantage of the custom footer with custom text on the left and filtered item count + timestamp on the right.
|
|
79
|
-
|
|
80
|
-

|
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
#### index
|
|
2
|
-
- [Column Definition - Custom Tooltip](#via-column-definition)
|
|
3
|
-
- [Grid Options - Custom Tooltip](#via-grid-options)
|
|
4
|
-
- [Alignment](#alignment)
|
|
5
|
-
- Tooltip Type
|
|
6
|
-
- [on Cell](#cell-custom-tooltip-with-formatter) with `formatter`
|
|
7
|
-
- [on Cell Async Tooltip](#cell-async-custom-tooltip-with-formatter-and-asyncpostformatter-async-api-call) (Async API call from Promise/Observable)
|
|
8
|
-
- [on Column Header (title)](#column-header-custom-tooltip-with-headerformatter) with `headerFormatter`
|
|
9
|
-
- [on Column Header row (filter)](#column-header-custom-tooltip-with-headerrowformatter) with `headerRowFormatter`
|
|
10
|
-
- [with regular `[title]` attribute](#regular-tooltip-with-a-title-attribute)
|
|
11
|
-
- [tooltip text length](#regular-tooltip-max-length)
|
|
12
|
-
- [How to delay the opening of a tooltip?](#how-to-delay-the-opening-of-a-tooltip)
|
|
13
|
-
- [delay a tooltip with Formatter](#delay-a-tooltip-with-formatter)
|
|
14
|
-
- [delay a Regular Tooltip](#delay-a-regular-tooltip)
|
|
15
|
-
- `customTooltip` options
|
|
16
|
-
- too many to list, consult the [CustomTooltipOption](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/interfaces/column.interface.ts) interface for all possible options
|
|
17
|
-
- [UI Sample](#ui-sample)
|
|
18
|
-
|
|
19
|
-
### Description
|
|
20
|
-
A plugin to add Custom Tooltip when hovering a cell, it subscribes to the cell `onMouseEnter` and `onMouseLeave` events.
|
|
21
|
-
The `customTooltip` is defined in the Column Definition OR Grid Options (the first found will have priority over the second)
|
|
22
|
-
To specify a tooltip when hovering a cell
|
|
23
|
-
|
|
24
|
-
**NOTE:** this is an opt-in plugin, you must import the necessary plugin from `@slickgrid-universal/custom-tooltip-plugin` and instantiate it in your grid options via `registerExternalResources`, see multiple examples below.
|
|
25
|
-
|
|
26
|
-
### Demo
|
|
27
|
-
[Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/custom-tooltip) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-custom-tooltip.component.ts)
|
|
28
|
-
|
|
29
|
-
### via Column Definition
|
|
30
|
-
You can set or change option of an individual column definition custom tooltip.
|
|
31
|
-
```ts
|
|
32
|
-
import { SlickCustomTooltip } from '@slickgrid-universal/custom-tooltip-plugin';
|
|
33
|
-
|
|
34
|
-
defineGrid() {
|
|
35
|
-
this.columnDefinitions = [{
|
|
36
|
-
id: "title", name: "Title", field: "title", formatter: titleFormatter,
|
|
37
|
-
customTooltip: {
|
|
38
|
-
formatter: tooltipTaskFormatter,
|
|
39
|
-
// ...
|
|
40
|
-
}
|
|
41
|
-
}];
|
|
42
|
-
|
|
43
|
-
// make sure to register the plugin in your grid options
|
|
44
|
-
this.gridOptions = {
|
|
45
|
-
externalResources: [new SlickCustomTooltip()],
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### via Grid Options
|
|
51
|
-
You can set certain options for the entire grid, for example if you set `exportWithFormatter` it will evaluate the Formatter (when exist) output to export each cell. The Grid Menu also has the "Export to Excel" enabled by default.
|
|
52
|
-
```ts
|
|
53
|
-
import { SlickCustomTooltip } from '@slickgrid-universal/custom-tooltip-plugin';
|
|
54
|
-
|
|
55
|
-
defineGrid() {
|
|
56
|
-
this.gridOptions = {
|
|
57
|
-
externalResources: [new SlickCustomTooltip()],
|
|
58
|
-
customTooltip: {
|
|
59
|
-
formatter: tooltipTaskFormatter,
|
|
60
|
-
|
|
61
|
-
// optionally skip tooltip on some of the column(s) (like 1st column when using row selection)
|
|
62
|
-
usabilityOverride: (args) => (args.cell !== 0 && args?.column?.id !== 'action'), // disable on 1st and also "action" column
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Alignment
|
|
69
|
-
The default alignment is "auto" (which will align to the left by default or on the right when there's not enough room). You can change the alignment on any of the cell (or all of them via grid option) by simply providing a value to the `position`.
|
|
70
|
-
|
|
71
|
-
The available position are: `'auto' | 'top' | 'bottom' | 'left-align' | 'right-align' | 'center'` (note that "center" was only added recently)
|
|
72
|
-
|
|
73
|
-
```ts
|
|
74
|
-
// define your custom tooltip in a Column Definition OR Grid Options
|
|
75
|
-
customTooltip: {
|
|
76
|
-
position: 'left-align'
|
|
77
|
-
},
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## Tooltip Types
|
|
81
|
-
### Cell Custom Tooltip with `formatter`
|
|
82
|
-
You can create a Custom Tooltip which will show up when hovering a cell by simply providing a `formatter` [via a Column Definition](#via-column-definition) (per column) OR [via Grid Options](#via-grid-options) (all columns of the grid), the formatter is the same structure as a regular formatter and accepts html string.
|
|
83
|
-
```ts
|
|
84
|
-
// define your custom tooltip in a Column Definition OR Grid Options
|
|
85
|
-
customTooltip: {
|
|
86
|
-
formatter: this.tooltipFormatter,
|
|
87
|
-
},
|
|
88
|
-
```
|
|
89
|
-
here's a simple formatter (you can see the result in the [UI Sample](#ui-sample) gif below)
|
|
90
|
-
```ts
|
|
91
|
-
tooltipFormatter(row, cell, value, column, dataContext, grid) {
|
|
92
|
-
const tooltipTitle = 'Custom Tooltip';
|
|
93
|
-
const effortDrivenHtml = Formatters.checkmarkMaterial(row, cell, dataContext.effortDriven, column, dataContext, grid);
|
|
94
|
-
|
|
95
|
-
return `<div class="header-tooltip-title">${tooltipTitle}</div>
|
|
96
|
-
<div class="tooltip-2cols-row"><div>Id:</div> <div>${dataContext.id}</div></div>
|
|
97
|
-
<div class="tooltip-2cols-row"><div>Title:</div> <div>${dataContext.title}</div></div>
|
|
98
|
-
<div class="tooltip-2cols-row"><div>Effort Driven:</div> <div>${effortDrivenHtml}</div></div>
|
|
99
|
-
<div class="tooltip-2cols-row"><div>Completion:</div> <div>${dataContext.percentComplete}</div></div>`;
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Cell Async Custom Tooltip with `formatter` and `asyncPostFormatter` (Async API call)
|
|
104
|
-
You can create an Async Custom Tooltip which is a delayed tooltip (for example when you call an API to fetch some info), will show up when hovering a cell it will require a bit more setup. The `formatter` will be use to show any form of "loading..." and your final tooltip will be shown via the `asyncPostFormatter` both formatters use the same structure as a regular formatter and accepts html string. It will also require you to provide an `asyncProcess` of your API call (it could be a Promise or Observable), it also provides the same arguments as a regular formatter.
|
|
105
|
-
```ts
|
|
106
|
-
// define your custom tooltip in a Column Definition OR Grid Options
|
|
107
|
-
customTooltip: {
|
|
108
|
-
// 1- loading formatter
|
|
109
|
-
formatter: () => `loading...</div>`,
|
|
110
|
-
|
|
111
|
-
// 2- post process formatter
|
|
112
|
-
asyncProcess: (row, cell, val, column, dataContext) => fetch(`/user/${dataContext.id}`), // could be a Promise/Observable
|
|
113
|
-
asyncPostFormatter: this.userFullDetailAsyncFormatter,
|
|
114
|
-
},
|
|
115
|
-
```
|
|
116
|
-
here's the final post process async formatter
|
|
117
|
-
```ts
|
|
118
|
-
userFullDetailAsyncFormatter(row, cell, value, column, dataContext, grid) {
|
|
119
|
-
const tooltipTitle = 'User Detail - Async Tooltip';
|
|
120
|
-
return `<div class="header-tooltip-title">${tooltipTitle}</div>
|
|
121
|
-
<div class="tooltip-2cols-row"><div>Id:</div> <div>${dataContext.id}</div></div>
|
|
122
|
-
<div class="tooltip-2cols-row"><div>First Name:</div> <div>${dataContext.firstName}</div></div>
|
|
123
|
-
<div class="tooltip-2cols-row"><div>Last Name:</div> <div>${dataContext.lastName}</div></div>
|
|
124
|
-
<div class="tooltip-2cols-row"><div>Age:</div> <div>${dataContext.age}</div></div>
|
|
125
|
-
<div class="tooltip-2cols-row"><div>Gender:</div> <div>${dataContext.gender}</div></div>
|
|
126
|
-
<div class="tooltip-2cols-row"><div>Title:</div> <div>${dataContext.title}</div></div>
|
|
127
|
-
<div class="tooltip-2cols-row"><div>Seniority:</div> <div>${dataContext.seniority}</div></div>`;
|
|
128
|
-
}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### Column Header Custom Tooltip with `headerFormatter`
|
|
132
|
-
You can create a Custom Tooltip which will show up when hovering a column header (title) by simply providing a `headerFormatter` [via a Column Definition](#via-column-definition) (per column) OR [via Grid Options](#via-grid-options) (all columns of the grid), the formatter is the same structure as a regular formatter and accepts html string.
|
|
133
|
-
```ts
|
|
134
|
-
// define your custom tooltip in a Column Definition OR Grid Options
|
|
135
|
-
customTooltip: {
|
|
136
|
-
headerFormatter: this.headerFormatter,
|
|
137
|
-
},
|
|
138
|
-
```
|
|
139
|
-
here's a simple formatter
|
|
140
|
-
```ts
|
|
141
|
-
headerFormatter(row, cell, value, column) {
|
|
142
|
-
const tooltipTitle = 'Custom Tooltip - Header';
|
|
143
|
-
return `<div class="header-tooltip-title">${tooltipTitle}</div>
|
|
144
|
-
<div class="tooltip-2cols-row"><div>Column:</div> <div>${column.name}</div></div>`;
|
|
145
|
-
}
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### Column Header Custom Tooltip with `headerRowFormatter`
|
|
149
|
-
You can create a Custom Tooltip which will show up when hovering a column header (title) by simply providing a `headerRowFormatter` [via a Column Definition](#via-column-definition) (per column) OR [via Grid Options](#via-grid-options) (all columns of the grid), the formatter is the same structure as a regular formatter and accepts html string.
|
|
150
|
-
```ts
|
|
151
|
-
// define your custom tooltip in a Column Definition OR Grid Options
|
|
152
|
-
customTooltip: {
|
|
153
|
-
headerRowFormatter: this.headerRowFormatter,
|
|
154
|
-
},
|
|
155
|
-
```
|
|
156
|
-
here's a simple formatter
|
|
157
|
-
```ts
|
|
158
|
-
headerRowFormatter(row, cell, value, column) {
|
|
159
|
-
const tooltipTitle = 'Custom Tooltip - Header Row (filter)';
|
|
160
|
-
return `<div class="headerrow-tooltip-title">${tooltipTitle}</div>
|
|
161
|
-
<div class="tooltip-2cols-row"><div>Column:</div> <div>${column.field}</div></div>`;
|
|
162
|
-
}
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### Regular Tooltip with a `[title]` attribute
|
|
166
|
-
You can create a regular tooltip simply by enabling `useRegularTooltip: true`, it will parse the regular cell formatter in search for a `title="..."` attribute (it won't work without a cell formatter, unless the cell text content is larger than the cell width when ellipsis shows up "some text..." and that will automatically create a tooltip, that could however be disabled if you wish).
|
|
167
|
-
|
|
168
|
-
This feature is very useful so you probably want to enable this flag globally, but you could also still choose to add only [via a Column Definition](#via-column-definition) (per column) OR [via Grid Options](#via-grid-options) (all columns of the grid).
|
|
169
|
-
|
|
170
|
-
NOTE: regular tooltip, as opposed to other type of custom tooltip, will be rendered as plain text. You could however change that by enabling this flag `renderRegularTooltipAsHtml: true`
|
|
171
|
-
|
|
172
|
-
```ts
|
|
173
|
-
// define your custom tooltip in a Column Definition OR Grid Options
|
|
174
|
-
customTooltip: {
|
|
175
|
-
useRegularTooltip: true, // a regular tooltip will search for a "title" attribute in the cell formatter (it won't work without a cell formatter)
|
|
176
|
-
|
|
177
|
-
// if you wish to disable auto-tooltip creation when ellipsis (...) shows up, can use this flag
|
|
178
|
-
// useRegularTooltipFromFormatterOnly: true,
|
|
179
|
-
},
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
#### Regular tooltip max length
|
|
183
|
-
By default the custom tooltip text will be limited, and potentially truncated, to 650 characters in order to keep the tooltip with a size that is not too large. You could change the grid option setting with this
|
|
184
|
-
|
|
185
|
-
```ts
|
|
186
|
-
this.gridOptions = {
|
|
187
|
-
customTooltip: {
|
|
188
|
-
tooltipTextMaxLength: 650,
|
|
189
|
-
},
|
|
190
|
-
}
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### How to delay the opening of a tooltip?
|
|
194
|
-
#### delay a Tooltip with Formatter
|
|
195
|
-
There are no built-in option to delay a custom tooltip because it would add too much code complexity to the codebase, however you can simply do that by taking advantage of the Async Custom Tooltip. The only thing you might want to do though is to have the first custom tooltip `formatter` to return an empty string (so it won't show a loading tooltip) and then use the `asyncPostFormatter` for the tooltip (note that it will **not** read the cell formatter, if you have requirement for that then simply combined formatter into an external formatter function, see 2nd examples below).
|
|
196
|
-
```ts
|
|
197
|
-
// define your custom tooltip in a Column Definition OR Grid Options
|
|
198
|
-
customTooltip: {
|
|
199
|
-
// 1- loading formatter
|
|
200
|
-
formatter: () => ``, // return empty so it won't show any pre-tooltip
|
|
201
|
-
|
|
202
|
-
// 2- delay the opening by a simple Promise and `setTimeout`
|
|
203
|
-
asyncProcess: () => new Promise(resolve => {
|
|
204
|
-
setTimeout(() => resolve({}), 500); // delayed by half a second
|
|
205
|
-
}),
|
|
206
|
-
asyncPostFormatter: this.userFullDetailAsyncFormatter,
|
|
207
|
-
},
|
|
208
|
-
```
|
|
209
|
-
#### delay a Regular Tooltip
|
|
210
|
-
It is possible to also delay a regular tooltip (when using `useRegularTooltip`) even when using the optional `useRegularTooltipFromFormatterOnly` but it requires a bit of code change. For example, let say you want to parse the `title` from a formatter but delay it, you could do it as shown below but please note that it will read the `asyncPostFormatter`, not the cell `formatter`, and so you should probably create an external formatter function to make simpler code.
|
|
211
|
-
|
|
212
|
-
##### tooltip text output will be: "show this tooltip title text"
|
|
213
|
-
```ts
|
|
214
|
-
// define your custom tooltip in a Column Definition OR Grid Options
|
|
215
|
-
this.columnDefinitions = [{
|
|
216
|
-
id: 'firstName', field: 'firstName', name: 'First Name',
|
|
217
|
-
customTooltip: {
|
|
218
|
-
// 1- loading formatter
|
|
219
|
-
formatter: () => ``, // return empty so it won't show any pre-tooltip
|
|
220
|
-
|
|
221
|
-
// 2- delay the opening by a simple Promise and `setTimeout`
|
|
222
|
-
asyncProcess: () => new Promise(resolve => setTimeout(() => resolve(null), 500)), // delayed by half a second
|
|
223
|
-
asyncPostFormatter: `<span title="show this tooltip title text">cell value</span>`, // this will be read as tooltip
|
|
224
|
-
},
|
|
225
|
-
formatter: `<span title="another tooltip title text">cell value</span>`, // this won't be read as tooltip
|
|
226
|
-
}];
|
|
227
|
-
```
|
|
228
|
-
the previous code could be refactored to have only 1 common formatter that is referenced in both cell `formatter` and tooltip `asyncPostFormatter`
|
|
229
|
-
##### tooltip text output will be: "show this tooltip title text"
|
|
230
|
-
```ts
|
|
231
|
-
const myFormatter = () => `<span title="show this tooltip title text">cell value</span>`;
|
|
232
|
-
|
|
233
|
-
// define your custom tooltip in a Column Definition OR Grid Options
|
|
234
|
-
this.columnDefinitions = [{
|
|
235
|
-
id: 'firstName', field: 'firstName', name: 'First Name',
|
|
236
|
-
customTooltip: {
|
|
237
|
-
// 1- loading formatter
|
|
238
|
-
formatter: () => ``, // return empty so it won't show any pre-tooltip
|
|
239
|
-
|
|
240
|
-
// 2- delay the opening by a simple Promise and `setTimeout`
|
|
241
|
-
asyncProcess: () => new Promise(resolve => setTimeout(() => resolve(null), 500)), // delayed by half a second
|
|
242
|
-
asyncPostFormatter: myFormatter
|
|
243
|
-
},
|
|
244
|
-
formatter: myFormatter
|
|
245
|
-
}];
|
|
246
|
-
```
|
|
247
|
-
### UI Sample
|
|
248
|
-
The Export to Excel handles all characters quite well, from Latin, to Unicode and even Unicorn emoji, it all works on all browsers (`Chrome`, `Firefox`, even `IE11`, I don't have access to older versions). Here's a demo
|
|
249
|
-
|
|
250
|
-

|
|
251
|
-
|
|
252
|
-
auto tooltip on large text, that is when ellipsis (...) shows up on large text
|
|
253
|
-
|
|
254
|
-

|
|
255
|
-
|
|
256
|
-
Async Custom Tooltip (API call Promise/Observable)
|
|
257
|
-
|
|
258
|
-

|