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,258 +0,0 @@
|
|
|
1
|
-
#### index
|
|
2
|
-
- CRUD Methods
|
|
3
|
-
- [Add Item](#add-an-item-row)
|
|
4
|
-
- [Delete Item](#delete-an-item-row)
|
|
5
|
-
- [Update Item](#update-an-item-row)
|
|
6
|
-
- [Upsert Item](#upsert-an-item-row)
|
|
7
|
-
- [Default Option Flags](#crud-default-option-flags)
|
|
8
|
-
- [Highlight a Row](#highlight-a-row-item)
|
|
9
|
-
|
|
10
|
-
### Description
|
|
11
|
-
When working with the grid, you might want to Add / Update or Hightlight an item row from the Datagrid.
|
|
12
|
-
|
|
13
|
-
**Note:** This is strictly a client side event, you still have to implement any backend change yourself.
|
|
14
|
-
|
|
15
|
-
### Demo
|
|
16
|
-
[Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/additem) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-additem.component.ts)
|
|
17
|
-
|
|
18
|
-
## CRUD Methods
|
|
19
|
-
### Add an Item (row)
|
|
20
|
-
Please note that you need to provide the `id` by yourself and remember that it has to be **unique**, else the `Slickgrid DataView` will throw you an error in the console.
|
|
21
|
-
|
|
22
|
-
##### View
|
|
23
|
-
```html
|
|
24
|
-
<angular-slickgrid gridId="grid2"
|
|
25
|
-
(onAngularGridCreated)="angularGridReady($event.detail)"
|
|
26
|
-
(onCellChange)="onCellChanged($event.detail.eventData, $event.detail.args)"
|
|
27
|
-
(onClick)="onCellClicked($event.detail.eventData, $event.detail.args)"
|
|
28
|
-
[columns]="columnDefinitions" [options]="gridOptions" [dataset]="dataset">
|
|
29
|
-
</angular-slickgrid>
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
##### Component
|
|
33
|
-
```typescript
|
|
34
|
-
import { Component, OnInit} from '@angular/core';
|
|
35
|
-
import { AngularGridInstance } from 'angular-slickgrid';
|
|
36
|
-
|
|
37
|
-
export class GridBasicComponent implements OnInit {
|
|
38
|
-
columnDefinitions: Column[];
|
|
39
|
-
gridOptions: GridOption;
|
|
40
|
-
dataset: any[];
|
|
41
|
-
|
|
42
|
-
ngOnInit(): void {
|
|
43
|
-
this.columnDefinitions = [];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
47
|
-
this.angularGrid = angularGrid;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
addNewItem() {
|
|
51
|
-
const newItem = {
|
|
52
|
-
id: this.dataset.length + 1, // it's up to you to decide on what the ID will be, as long as it's unique
|
|
53
|
-
// ... your item properties
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// add the item to the grid
|
|
57
|
-
this.angularGrid.gridService.addItem(newItem);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
#### Add Item Position (top/bottom)
|
|
63
|
-
When adding an item, you can add it on top (default) of the grid or at the bottom of the grid. In order to change that, you can use the `position` property.
|
|
64
|
-
```ts
|
|
65
|
-
// add the item to the end of grid
|
|
66
|
-
this.angularGrid.gridService.addItem(newItem, { position: 'bottom' });
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
#### Change default flags
|
|
70
|
-
When adding an item, you have access to change any of the default flags through the second argument of `addItem` method.
|
|
71
|
-
```ts
|
|
72
|
-
// add the item to the end of grid
|
|
73
|
-
this.angularGrid.gridService.addItem(newItem, {
|
|
74
|
-
// the defaults are shown below
|
|
75
|
-
highlightRow: true, // do we want to highlight the row after the insert
|
|
76
|
-
position: 'top', // which position of the grid to add the item
|
|
77
|
-
resortGrid: false, // do we want to resort the grid after the insert
|
|
78
|
-
selectRow: false, // do we want to select the row after the insert
|
|
79
|
-
triggerEvent: true // do we want to trigger an event after the insert
|
|
80
|
-
});
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Delete an Item (row)
|
|
84
|
-
To delete a row, you can use `deleteItem(s)` and the pass the entire object(s) or use `deleteItemById(s) in which you need to provide the object `id` to delete and the method will find it in the grid and remove it from the grid. Also please note that it's only deleting from the grid (by removing it from the DataView), meaning that it won't remove it from your database.
|
|
85
|
-
|
|
86
|
-
##### View
|
|
87
|
-
```html
|
|
88
|
-
<angular-slickgrid gridId="grid2"
|
|
89
|
-
(onAngularGridCreated)="angularGridReady($event.detail)"
|
|
90
|
-
(onClick)="onCellClicked($event.detail.eventData, $event.detail.args)"
|
|
91
|
-
[columns]="columnDefinitions"
|
|
92
|
-
[options]="gridOptions"
|
|
93
|
-
[dataset]="dataset">
|
|
94
|
-
</angular-slickgrid>
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
##### Component
|
|
98
|
-
```typescript
|
|
99
|
-
import { Component, OnInit} from '@angular/core';
|
|
100
|
-
import { AngularGridInstance } from 'angular-slickgrid';
|
|
101
|
-
|
|
102
|
-
export class GridBasicComponent implements OnInit {
|
|
103
|
-
columnDefinitions: Column[];
|
|
104
|
-
gridOptions: GridOption;
|
|
105
|
-
dataset: any[];
|
|
106
|
-
|
|
107
|
-
ngOnInit(): void {
|
|
108
|
-
this.columnDefinitions = [];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
112
|
-
this.angularGrid = angularGrid;
|
|
113
|
-
this.gridObj = angularGrid.grid;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
removeItem(itemId: number | string) {
|
|
117
|
-
// remove the item from the grid
|
|
118
|
-
this.angularGrid.gridService.deleteItemById(itemId);
|
|
119
|
-
|
|
120
|
-
// or multiple Ids passed as an array (number or string)
|
|
121
|
-
// this.angularGrid.gridService.deleteItemByIds([1, 2]); // e.g. remove user id 1 and 2
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
#### Change default flags
|
|
127
|
-
When adding an item, you have access to change any of the default flags through the second argument of `addItem` method.
|
|
128
|
-
```ts
|
|
129
|
-
// add the item to the end of grid
|
|
130
|
-
this.angularGrid.gridService.deleteItemById(123, {
|
|
131
|
-
// the defaults are shown below
|
|
132
|
-
triggerEvent: true // do we want to trigger an event after the insert
|
|
133
|
-
});
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### Update an Item (row)
|
|
137
|
-
To update an item, you can use `updateItem(s)` and the pass the entire object(s) in this case it does not require you to know the row number, it will try to find the row by itself (it uses the "id" for that) and update the item. The other way would be to use `updateItemById` in which you need to provide the object `id` to update the item.
|
|
138
|
-
|
|
139
|
-
##### Component
|
|
140
|
-
```typescript
|
|
141
|
-
import { Component, OnInit, Injectable } from '@angular/core';
|
|
142
|
-
import { AngularGridInstance } from 'angular-slickgrid';
|
|
143
|
-
|
|
144
|
-
@Injectable()
|
|
145
|
-
export class GridBasicComponent implements OnInit {
|
|
146
|
-
columnDefinitions: Column[];
|
|
147
|
-
gridOptions: GridOption;
|
|
148
|
-
dataset: any[];
|
|
149
|
-
|
|
150
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
151
|
-
this.angularGrid = angularGrid;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
ngOnInit(): void {
|
|
155
|
-
this.columnDefinitions = [];
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
updateItem(upItem) {
|
|
159
|
-
this.angularGrid.gridService.updateItem(upItem);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
#### Change default flags
|
|
165
|
-
When adding an item, you have access to change any of the default flags through the second argument of `addItem` method.
|
|
166
|
-
```ts
|
|
167
|
-
// add the item to the end of grid
|
|
168
|
-
this.angularGrid.gridService.updateItem(newItem, {
|
|
169
|
-
// the defaults are shown below
|
|
170
|
-
highlightRow: true, // do we want to highlight the row after the update
|
|
171
|
-
selectRow: false, // do we want to select the row after the update
|
|
172
|
-
scrollRowIntoView: false, // do we want to scroll the row into the viewport after the update
|
|
173
|
-
triggerEvent: true // do we want to trigger an event after the update
|
|
174
|
-
});
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
### Upsert an Item (row)
|
|
178
|
-
Upsert will do an Insert when not found or update if it found the item already exist in the grid.
|
|
179
|
-
|
|
180
|
-
##### Component
|
|
181
|
-
```typescript
|
|
182
|
-
import { Component, OnInit, Injectable } from '@angular/core';
|
|
183
|
-
import { AngularGridInstance } from 'angular-slickgrid';
|
|
184
|
-
|
|
185
|
-
@Injectable()
|
|
186
|
-
export class GridBasicComponent implements OnInit {
|
|
187
|
-
columnDefinitions: Column[];
|
|
188
|
-
gridOptions: GridOption;
|
|
189
|
-
dataset: any[];
|
|
190
|
-
|
|
191
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
192
|
-
this.angularGrid = angularGrid;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
ngOnInit(): void {
|
|
196
|
-
this.columnDefinitions = [];
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
updateItem(upItem) {
|
|
200
|
-
this.angularGrid.gridService.upsertItem(upItem);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
### CRUD Default Option Flags
|
|
206
|
-
All the CRUD methods have default option flags that can be changed which will do certain actions. The default option flags are the following for each of the CRUD method (`upsert` will use the flags of the insert or the update depending on which method it calls).
|
|
207
|
-
```ts
|
|
208
|
-
const GridServiceDeleteOptionDefaults: GridServiceDeleteOption = {
|
|
209
|
-
triggerEvent: true // do we want to trigger an event after the insert
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
const GridServiceInsertOptionDefaults: GridServiceInsertOption = {
|
|
213
|
-
highlightRow: true, // do we want to highlight the row after the insert
|
|
214
|
-
position: 'top', // which position of the grid to add the item
|
|
215
|
-
resortGrid: false, // do we want to resort the grid after the insert
|
|
216
|
-
selectRow: false, // do we want to select the row after the insert
|
|
217
|
-
triggerEvent: true // do we want to trigger an event after the insert
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
const GridServiceUpdateOptionDefaults: GridServiceUpdateOption = {
|
|
221
|
-
highlightRow: true, // do we want to highlight the row after the update
|
|
222
|
-
selectRow: false, // do we want to select the row after the update
|
|
223
|
-
scrollRowIntoView: false, // do we want to scroll the row into the viewport after the update
|
|
224
|
-
triggerEvent: true // do we want to trigger an event after the update
|
|
225
|
-
};
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
## Highlight a row item
|
|
229
|
-
Highlighting a row is customizable with SASS, you can change the highlighted color and/or animation by changing the [SASS variables](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/styles/_variables.scss) `$row-highlight-background-color` and/or `$row-highlight-fade-animation`
|
|
230
|
-
Take a look at all the available [SASS variables](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/styles/_variables.scss).
|
|
231
|
-
|
|
232
|
-
##### Component
|
|
233
|
-
```typescript
|
|
234
|
-
import { Component, OnInit, Injectable } from '@angular/core';
|
|
235
|
-
import { AngularGridInstance } from 'angular-slickgrid';
|
|
236
|
-
|
|
237
|
-
@Injectable()
|
|
238
|
-
export class GridBasicComponent implements OnInit {
|
|
239
|
-
columnDefinitions: Column[];
|
|
240
|
-
gridOptions: GridOption;
|
|
241
|
-
dataset: any[];
|
|
242
|
-
|
|
243
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
244
|
-
this.angularGrid = angularGrid;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
ngOnInit(): void {
|
|
248
|
-
this.columnDefinitions = [];
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
updateItem(rowNumber) {
|
|
252
|
-
const fadingDelay = 2000; // in milliseconds
|
|
253
|
-
|
|
254
|
-
// you can pass an optional fading delay (1500ms by default)
|
|
255
|
-
this.angularGrid.gridService.highlightRow(rowNumber, fadingDelay);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
```
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
### Description
|
|
2
|
-
You can use Colspan and/or Rowspan by using the DataView Item Metadata Provider, however please note that row spanning is under a flag because of its small perf hit (`rowspan` requires an initial loop through of all row item metadata to map all row span).
|
|
3
|
-
|
|
4
|
-
> [!NOTE]
|
|
5
|
-
> Please note that `colspan` and `rowspan` have multiple constraints that you must be aware,
|
|
6
|
-
> any side effects will **not** keep anything in sync since metadata are based on grid row index based...
|
|
7
|
-
> for example: Filtering/Sorting/Paging/ColumnReorder/ColumnHidding
|
|
8
|
-
> These side effect will require user's own logic to deal with such things!
|
|
9
|
-
|
|
10
|
-
### Demo
|
|
11
|
-
|
|
12
|
-
#### Colspan / Rowspan
|
|
13
|
-
[Employee Timesheets](https://ghiscoding.github.io/Angular-Slickgrid/#/rowspan-timesheets) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid43.component.ts)
|
|
14
|
-
|
|
15
|
-
[Large Dataset](https://ghiscoding.github.io/Angular-Slickgrid/#/rowspan-large) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid44.component.ts)
|
|
16
|
-
|
|
17
|
-
### Basic Usage
|
|
18
|
-
|
|
19
|
-
You can see a basic example below where we set static `metadata`, however you will must often use it with dynamic `metadata`, and it works in both cases. From the example below, the first object key is a number, `0` in our case, which represents the row index (again this can be dynamic). Then if we continue drilling down, we get a `columns` property which holds another object containing all the column indexes that will have a span (which can be individual `colspan`, `rowspan` or both of them at the same time).
|
|
20
|
-
|
|
21
|
-
What if we have a side effect that kicks in, for example a Sorting, Filtering, ...?
|
|
22
|
-
Well, that is where you the developer will have to add your own logic to update this `metadata` with the expected code logic of what and how it's supposed to behave. Because as mentioned in the note above, the library is pretty dumb and does not know what is the expected behavior for any side effects and it **will not change any** of the `metadata` spans, you have to implement such logic yourself (for example, if we drag a column to another position then the `rowspan` will stay at the same exact column index which is most probably not what you want, you could subscribe to the `onColumnsChanged` to deal with this one). You can see the full list of Events that you can listen for changes and implement necessary callback to update your `metadata` accordingly (see [List of Available Events](https://ghiscoding.gitbook.io/angular-slickgrid/events/available-events) docs).
|
|
23
|
-
|
|
24
|
-
##### Component
|
|
25
|
-
|
|
26
|
-
```ts
|
|
27
|
-
import type { Column, GridOption, ItemMetadata } from 'angular-slickgrid';
|
|
28
|
-
|
|
29
|
-
@Component({
|
|
30
|
-
styleUrls: ['grid43.component.scss'],
|
|
31
|
-
templateUrl: './grid43.component.html',
|
|
32
|
-
encapsulation: ViewEncapsulation.None,
|
|
33
|
-
})
|
|
34
|
-
export class Grid43Component implements OnInit {
|
|
35
|
-
gridOptions: GridOption;
|
|
36
|
-
columnDefinitions: Column[];
|
|
37
|
-
dataset: any[] = [];
|
|
38
|
-
|
|
39
|
-
// metadata can be dynamic too, it doesn't have to be preset
|
|
40
|
-
metadata: ItemMetadata | Record<number, ItemMetadata> = {
|
|
41
|
-
0: {
|
|
42
|
-
columns: {
|
|
43
|
-
1: { rowspan: 2 },
|
|
44
|
-
2: { colspan: 2 },
|
|
45
|
-
10: { colspan: 3, rowspan: 10 },
|
|
46
|
-
13: { colspan: 2 },
|
|
47
|
-
17: { colspan: 2, rowspan: 2 },
|
|
48
|
-
},
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
ngOnInit(): void {
|
|
53
|
-
// define the grid options & columns and then create the grid itself
|
|
54
|
-
this.defineGrid();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
defineGrid() {
|
|
58
|
-
this.columnDefinitions = [ /*...*/ ];
|
|
59
|
-
|
|
60
|
-
this.gridOptions = {
|
|
61
|
-
enableCellNavigation: true,
|
|
62
|
-
enableCellRowSpan: true, // required for rowspan to work
|
|
63
|
-
dataView: {
|
|
64
|
-
globalItemMetadataProvider: {
|
|
65
|
-
getRowMetadata: (_item, row) => {
|
|
66
|
-
return this.metadata[row];
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
rowTopOffsetRenderType: 'top', // rowspan doesn't render well with 'transform', default is 'top'
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
```
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
SlickGrid is very flexible and it allows you to change or add CSS Class(es) dynamically (or on page load) by changing it's `Item Metadata` (see [SlickGrid Wiki - Item Metadata](providing-grid-data.md)). There is also a Stack Overflow [answer](https://stackoverflow.com/a/19985148/1212166), which this code below is based from.
|
|
2
|
-
|
|
3
|
-
### Demo
|
|
4
|
-
[Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/additem) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-additem.component.ts)
|
|
5
|
-
|
|
6
|
-
### Dynamically Change CSS Classes
|
|
7
|
-
##### View
|
|
8
|
-
```html
|
|
9
|
-
<button class="btn btn-sm btn-default" (click)="changeDurationBackgroundColor()">Highlight Rows with Duration over 50</button>
|
|
10
|
-
|
|
11
|
-
<angular-slickgrid gridId="grid2"
|
|
12
|
-
[columns]="columnDefinitions"
|
|
13
|
-
[options]="gridOptions"
|
|
14
|
-
[dataset]="dataset"
|
|
15
|
-
(onAngularGridCreated)="angularGridReady($event.detail)">
|
|
16
|
-
</angular-slickgrid>
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
##### Component
|
|
20
|
-
```typescript
|
|
21
|
-
// VERY IMPORTANT
|
|
22
|
-
// changing CSS Styles only seems to work with Encapsulation set to None
|
|
23
|
-
@Component({
|
|
24
|
-
styles: ['.duration-bg { background-color: #e9d4f1 !important }'],
|
|
25
|
-
encapsulation: ViewEncapsulation.None,
|
|
26
|
-
templateUrl: './grid-additem.component.html'
|
|
27
|
-
})
|
|
28
|
-
export class Example {
|
|
29
|
-
// get the SlickGrid Grid & DataView object references
|
|
30
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
31
|
-
this.angularGrid = angularGrid;
|
|
32
|
-
this.dataView = angularGrid.dataView;
|
|
33
|
-
this.grid = angularGrid.slickGrid;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Change the Duration Rows Background Color
|
|
38
|
-
* You need to get previous SlickGrid DataView Item Metadata and override it
|
|
39
|
-
*/
|
|
40
|
-
changeDurationBackgroundColor() {
|
|
41
|
-
this.dataView.getItemMetadata = this.updateItemMetadataForDurationOver50(this.dataView.getItemMetadata);
|
|
42
|
-
|
|
43
|
-
// also re-render the grid for the styling to be applied right away
|
|
44
|
-
this.grid.invalidate();
|
|
45
|
-
this.grid.render();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Override the SlickGrid Item Metadata, we will add a CSS class on all rows with a Duration over 50
|
|
50
|
-
* For more info, you can see this SO https://stackoverflow.com/a/19985148/1212166
|
|
51
|
-
*/
|
|
52
|
-
updateItemMetadataForDurationOver50(previousItemMetadata: any) {
|
|
53
|
-
const newCssClass = 'duration-bg';
|
|
54
|
-
|
|
55
|
-
return (rowNumber: number) => {
|
|
56
|
-
const item = this.dataView.getItem(rowNumber);
|
|
57
|
-
let meta = {
|
|
58
|
-
cssClasses: ''
|
|
59
|
-
};
|
|
60
|
-
if (typeof previousItemMetadata === 'object') {
|
|
61
|
-
meta = previousItemMetadata(rowNumber);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// our condition to check Duration over 50
|
|
65
|
-
if (meta && item && item.duration) {
|
|
66
|
-
const duration = +item.duration; // convert to number
|
|
67
|
-
if (duration > 50) {
|
|
68
|
-
meta.cssClasses = (meta.cssClasses || '') + ' ' + newCssClass;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return meta;
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### On Page Load
|
|
79
|
-
Or if you want to apply the styling right after the page load
|
|
80
|
-
|
|
81
|
-
##### Component
|
|
82
|
-
```typescript
|
|
83
|
-
export class Example {
|
|
84
|
-
|
|
85
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
86
|
-
this.angularGrid = angularGrid;
|
|
87
|
-
this.dataView = angularGrid.dataView;
|
|
88
|
-
this.grid = angularGrid.slickGrid;
|
|
89
|
-
|
|
90
|
-
// if you want to change background color of Duration over 50 right after page load,
|
|
91
|
-
// you would put the code here, also make sure to re-render the grid for the styling to be applied right away
|
|
92
|
-
this.dataView.getItemMetadata = this.updateItemMetadataForDurationOver50(this.dataView.getItemMetadata);
|
|
93
|
-
this.grid.invalidate();
|
|
94
|
-
this.grid.render();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Change the SlickGrid Item Metadata, we will add a CSS class on all rows with a Duration over 50
|
|
99
|
-
* For more info, you can see this SO https://stackoverflow.com/a/19985148/1212166
|
|
100
|
-
*/
|
|
101
|
-
updateItemMetadataForDurationOver50(previousItemMetadata: any) {
|
|
102
|
-
const newCssClass = 'duration-bg';
|
|
103
|
-
|
|
104
|
-
return (rowNumber: number) => {
|
|
105
|
-
const item = this.dataView.getItem(rowNumber);
|
|
106
|
-
let meta = {
|
|
107
|
-
cssClasses: ''
|
|
108
|
-
};
|
|
109
|
-
if (typeof previousItemMetadata === 'object') {
|
|
110
|
-
meta = previousItemMetadata(rowNumber);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (meta && item && item.duration) {
|
|
114
|
-
const duration = +item.duration; // convert to number
|
|
115
|
-
if (duration > 50) {
|
|
116
|
-
meta.cssClasses = (meta.cssClasses || '') + ' ' + newCssClass;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return meta;
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
```
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
### Description
|
|
2
|
-
Just like Excel you can select multiple cell and copy (`Ctrl+C`) and paste to Excel (`Ctrl+V`). However what you must know is that this plugin evaluate every single cell by their values (the raw value unless you specify otherwise, continue reading for more info).
|
|
3
|
-
|
|
4
|
-
### Demo
|
|
5
|
-
#### with Inline Editor
|
|
6
|
-
[Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/editor) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-editor.component.ts)
|
|
7
|
-
|
|
8
|
-
#### with Localization
|
|
9
|
-
[Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/localization) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-localization.component.ts)
|
|
10
|
-
|
|
11
|
-
### Usage
|
|
12
|
-
All you need to do is enable the Grid Option `enableExcelCopyBuffer: true` and give it a try. From your grid, start selecting multiple cells with the mouse then copy (with `Ctrl+C`) and paste to Excel (with `Ctrl+V`)
|
|
13
|
-
|
|
14
|
-
##### Component
|
|
15
|
-
```typescript
|
|
16
|
-
this.columnDefinitions = [
|
|
17
|
-
{ id: 'title', name: 'Title', field: 'id' },
|
|
18
|
-
{ id: 'description', name: 'Description', field: 'description' },
|
|
19
|
-
{ id: 'duration', name: 'Duration (days)', field: 'duration', type: 'number' },
|
|
20
|
-
];
|
|
21
|
-
this.gridOptions = {
|
|
22
|
-
enableExcelCopyBuffer: true,
|
|
23
|
-
};
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### Copy & Paste with Cell Formatter
|
|
27
|
-
What if you have a date in UTC format in your dataset but your grid shows it as a Date ISO format? In that case, you are using a Formatter (e.g. `formatter: Formatters.dateIso`) and you wish to use that formatter. Good news, that is supported with and to make is simpler for the implementation, we will use a flag that already exist which is `exportWithFormatter` and is used by the `Export to File` service (for more info, read [Wiki - Export to File](Export-to-Text-File.md)
|
|
28
|
-
|
|
29
|
-
The `exportWithFormatter` can be used in 2 ways, on each column definition independently or for the entire grid through it's grid option.
|
|
30
|
-
##### `exportWithFormatter` through each Column Definition
|
|
31
|
-
```typescript
|
|
32
|
-
this.columnDefinitions = [
|
|
33
|
-
{
|
|
34
|
-
id: 'start', name: 'Start', field: 'start',
|
|
35
|
-
formatter: Formatters.dateIso,
|
|
36
|
-
exportWithFormatter: true
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
id: 'finish', name: 'Finish', field: 'finish',
|
|
40
|
-
formatter: Formatters.dateIso,
|
|
41
|
-
exportWithFormatter: true
|
|
42
|
-
},
|
|
43
|
-
];
|
|
44
|
-
|
|
45
|
-
this.gridOptions = {
|
|
46
|
-
enableExcelCopyBuffer: true,
|
|
47
|
-
};
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
##### `exportWithFormatter` through Grid Options
|
|
51
|
-
```typescript
|
|
52
|
-
this.columnDefinitions = [
|
|
53
|
-
{ id: 'start', name: 'Start', field: 'start', formatter: Formatters.dateIso },
|
|
54
|
-
{ id: 'finish', name: 'Finish', field: 'finish', formatter: Formatters.dateIso },
|
|
55
|
-
];
|
|
56
|
-
|
|
57
|
-
this.gridOptions = {
|
|
58
|
-
enableExcelCopyBuffer: true,
|
|
59
|
-
exportOptions: {
|
|
60
|
-
// set at the grid option level, meaning all column will evaluate the Formatter (when it has a Formatter defined)
|
|
61
|
-
exportWithFormatter: true
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
```
|
|
65
|
-
#### Sanitize Formatter Ouput
|
|
66
|
-
In some cases a Formatter can be formed of HTML and that will end up showing in your Copy+Paste. You can simply use the `sanitizeDataExport` flag which will remove any HTML tags from the output. For an example below, let say that our first Title column are all displayed in bold in the grid (e.g. `<b>Title 1</b>`), we want to sanitize that output a regular text output (e.g. `Title 1`)
|
|
67
|
-
|
|
68
|
-
##### `exportWithFormatter` through each Column Definition
|
|
69
|
-
```typescript
|
|
70
|
-
this.columnDefinitions = [
|
|
71
|
-
{
|
|
72
|
-
id: 'title', name: 'Title', field: 'id',
|
|
73
|
-
formatter: Formatters.bold,
|
|
74
|
-
exportWithFormatter: true,
|
|
75
|
-
sanitizeDataExport: true
|
|
76
|
-
}
|
|
77
|
-
];
|
|
78
|
-
|
|
79
|
-
this.gridOptions = {
|
|
80
|
-
enableExcelCopyBuffer: true
|
|
81
|
-
};
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
##### `exportWithFormatter` through Grid Options
|
|
85
|
-
```typescript
|
|
86
|
-
this.columnDefinitions = [
|
|
87
|
-
{ id: 'title', name: 'Title', field: 'id', formatter: Formatters.bold }
|
|
88
|
-
];
|
|
89
|
-
|
|
90
|
-
this.gridOptions = {
|
|
91
|
-
enableExcelCopyBuffer: true,
|
|
92
|
-
exportOptions: {
|
|
93
|
-
exportWithFormatter: true,
|
|
94
|
-
sanitizeDataExport: true
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Disable pasting on specific columns
|
|
100
|
-
If you want to disable pasting values for specific columns you can deactivate it using the denyPaste property on the Column config.
|
|
101
|
-
|
|
102
|
-
```typescript
|
|
103
|
-
this.columnDefinitions = [
|
|
104
|
-
{
|
|
105
|
-
id: 'colA', name: 'Col A', field: 'col_a',
|
|
106
|
-
formatter: Formatters.bold,
|
|
107
|
-
exportWithFormatter: true,
|
|
108
|
-
sanitizeDataExport: true,
|
|
109
|
-
denyPaste: true // <------------
|
|
110
|
-
}
|
|
111
|
-
];
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
This will even work in situations where your table copy buffer stretches over disabled cells, by simply skipping them. So for the following config (x = paste disabled; o = paste enabled), pasting a 3 cell stretching table buffer will result in Col A and C being updated but ColB ignoring the paste and keeping its original value
|
|
115
|
-
|
|
116
|
-
Col A | Col B | Col C \
|
|
117
|
-
\---------------------\
|
|
118
|
-
o | x | o \
|
|
119
|
-
NEW | x | NEW
|
|
120
|
-
|
|
121
|
-
### Disable pasting on specific cells
|
|
122
|
-
If you need even more fine grained control, you can make use of the gridOption `onBeforePasteCell`:
|
|
123
|
-
|
|
124
|
-
```typescript
|
|
125
|
-
this.gridOptions = {
|
|
126
|
-
enableExcelCopyBuffer: true,
|
|
127
|
-
excelCopyBufferOptions: {
|
|
128
|
-
onBeforePasteCell: (e, args) => {
|
|
129
|
-
// e.g deny paste on first cell
|
|
130
|
-
return args.cell > 0;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
This way you have full control, via the args parameters, to get a ref to the current row and cell being updated. Also keep in mind that while performing a buffered table paste (e.g three cols at once) and only one of them has a denying condition, the other cells paste will pass successfully.
|
|
137
|
-
|
|
138
|
-
### Handling quoted multiline pastes
|
|
139
|
-
When copying Excel cells, where the value is a multiline text, the copy buffer will result in a quoted text buffer. Slickgrid will properly handle the case when this content itself contains `\n` characters, to not break onto multiple rows as well as not split on the next column if `\t` characters are contained.
|
|
140
|
-
|
|
141
|
-
You can control if the newlines should be replaced with a specific value by defining it in `replaceNewlinesWith`. As an example you could set it to `' '`.
|
|
142
|
-
|
|
143
|
-
Additionally, you can define that the quoted string is pasted without the quotes by setting `removeDoubleQuotesOnPaste` to true.
|
|
144
|
-
|
|
145
|
-
> Note: requires v8.2.0 and higher
|