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,104 +0,0 @@
|
|
|
1
|
-
<div class="demo38">
|
|
2
|
-
<h2>
|
|
3
|
-
Example 38: OData (v4) Backend Service with Infinite Scroll
|
|
4
|
-
<span class="float-end">
|
|
5
|
-
<a
|
|
6
|
-
style="font-size: 18px"
|
|
7
|
-
target="_blank"
|
|
8
|
-
href="https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-infinite-odata.component.ts"
|
|
9
|
-
>
|
|
10
|
-
<span class="mdi mdi-link-variant"></span> code
|
|
11
|
-
</a>
|
|
12
|
-
</span>
|
|
13
|
-
</h2>
|
|
14
|
-
|
|
15
|
-
<h6 class="title is-6 italic content">
|
|
16
|
-
<ul>
|
|
17
|
-
<li>
|
|
18
|
-
Infinite scrolling allows the grid to lazy-load rows from the server when reaching the scroll bottom (end) position. In its simplest
|
|
19
|
-
form, the more the user scrolls down, the more rows get loaded. If we reached the end of the dataset and there is no more data to
|
|
20
|
-
load, then we'll assume to have the entire dataset loaded in memory. This contrast with the regular Pagination approach which will
|
|
21
|
-
hold only hold data for 1 page at a time.
|
|
22
|
-
</li>
|
|
23
|
-
<li>NOTES</li>
|
|
24
|
-
<ol>
|
|
25
|
-
<li>
|
|
26
|
-
<code>presets.pagination</code> is not supported with Infinite Scroll and will revert to the first page, simply because since we
|
|
27
|
-
keep appending data, we always have to start from index zero (no offset).
|
|
28
|
-
</li>
|
|
29
|
-
<li>
|
|
30
|
-
Pagination is not shown BUT in fact, that is what is being used behind the scene whenever reaching the scroll end (fetching next
|
|
31
|
-
batch).
|
|
32
|
-
</li>
|
|
33
|
-
<li>Also note that whenever the user changes the Sort(s)/Filter(s) it will always reset and go back to zero index (first page).</li>
|
|
34
|
-
</ol>
|
|
35
|
-
</ul>
|
|
36
|
-
</h6>
|
|
37
|
-
|
|
38
|
-
<div class="row">
|
|
39
|
-
<div class="col-sm-3">
|
|
40
|
-
<div class="alert alert-danger" *ngIf="errorStatus" data-test="error-status">
|
|
41
|
-
<em><strong>Backend Error:</strong> <span [innerHTML]="errorStatus"></span></em>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
<div class="row">
|
|
47
|
-
<div class="col-sm-2">
|
|
48
|
-
<div [class]="status.class" role="alert" data-test="status">
|
|
49
|
-
<strong>Status: </strong> {{ status.text }}
|
|
50
|
-
<span [hidden]="!processing">
|
|
51
|
-
<i class="mdi mdi-sync mdi-spin-1s"></i>
|
|
52
|
-
</span>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
<div class="col-sm-10">
|
|
56
|
-
<div class="alert alert-info" data-test="alert-odata-query">
|
|
57
|
-
<strong>OData Query:</strong> <span data-test="odata-query-result">{{ odataQuery }}</span>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
<div class="row">
|
|
63
|
-
<div class="col-sm-12">
|
|
64
|
-
<button
|
|
65
|
-
class="btn btn-outline-secondary btn-sm btn-icon"
|
|
66
|
-
data-test="clear-filters-sorting"
|
|
67
|
-
(click)="clearAllFiltersAndSorts()"
|
|
68
|
-
title="Clear all Filters & Sorts"
|
|
69
|
-
>
|
|
70
|
-
<i class="mdi mdi-filter-remove-outline"></i>
|
|
71
|
-
Clear all Filter & Sorts
|
|
72
|
-
</button>
|
|
73
|
-
<button class="btn btn-outline-secondary btn-sm" data-test="set-dynamic-filter" (click)="setFiltersDynamically()">
|
|
74
|
-
Set Filters Dynamically
|
|
75
|
-
</button>
|
|
76
|
-
<button class="btn btn-outline-secondary btn-sm" data-test="set-dynamic-sorting" (click)="setSortingDynamically()">
|
|
77
|
-
Set Sorting Dynamically
|
|
78
|
-
</button>
|
|
79
|
-
<button class="btn btn-outline-secondary btn-sm" data-test="group-by-gender" (click)="groupByGender()">Group by Gender</button>
|
|
80
|
-
|
|
81
|
-
<div *ngIf="metrics" class="mt-2" style="margin: 10px 0px">
|
|
82
|
-
<b>Metrics:</b>
|
|
83
|
-
<span>
|
|
84
|
-
<span>{{ metrics.endTime | date: 'dd MMM, h:mm:ssa' }}</span> —
|
|
85
|
-
<span data-test="itemCount">{{ metrics.itemCount }}</span>
|
|
86
|
-
of
|
|
87
|
-
<span data-test="totalItemCount">{{ metrics.totalItemCount }}</span>
|
|
88
|
-
items
|
|
89
|
-
</span>
|
|
90
|
-
<span class="badge rounded-pill text-bg-primary" [class]="tagDataClass" data-test="data-loaded-tag">All Data Loaded!!!</span>
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
<angular-slickgrid
|
|
96
|
-
gridId="grid38"
|
|
97
|
-
[columns]="columnDefinitions"
|
|
98
|
-
[options]="gridOptions"
|
|
99
|
-
[dataset]="dataset"
|
|
100
|
-
(onAngularGridCreated)="angularGridReady($event.detail)"
|
|
101
|
-
(onRowCountChanged)="refreshMetrics($event.detail.args)"
|
|
102
|
-
>
|
|
103
|
-
</angular-slickgrid>
|
|
104
|
-
</div>
|
|
@@ -1,420 +0,0 @@
|
|
|
1
|
-
import { GridOdataService, type OdataServiceApi } from '@slickgrid-universal/odata';
|
|
2
|
-
import { ChangeDetectorRef, Component, OnInit, ViewEncapsulation } from '@angular/core';
|
|
3
|
-
import { HttpClient } from '@angular/common/http';
|
|
4
|
-
import {
|
|
5
|
-
Aggregators,
|
|
6
|
-
AngularGridInstance,
|
|
7
|
-
Column,
|
|
8
|
-
Filters,
|
|
9
|
-
GridOption,
|
|
10
|
-
Grouping,
|
|
11
|
-
Metrics,
|
|
12
|
-
OnRowCountChangedEventArgs,
|
|
13
|
-
SortComparers,
|
|
14
|
-
} from '../../library';
|
|
15
|
-
|
|
16
|
-
const sampleDataRoot = 'assets/data';
|
|
17
|
-
const CARET_HTML_ESCAPED = '%5E';
|
|
18
|
-
const PERCENT_HTML_ESCAPED = '%25';
|
|
19
|
-
|
|
20
|
-
@Component({
|
|
21
|
-
styleUrls: ['./example38.component.scss'],
|
|
22
|
-
encapsulation: ViewEncapsulation.None,
|
|
23
|
-
templateUrl: './example38.component.html',
|
|
24
|
-
standalone: false,
|
|
25
|
-
})
|
|
26
|
-
export class Example38Component implements OnInit {
|
|
27
|
-
angularGrid!: AngularGridInstance;
|
|
28
|
-
backendService: GridOdataService;
|
|
29
|
-
columnDefinitions!: Column[];
|
|
30
|
-
gridOptions!: GridOption;
|
|
31
|
-
dataset: any[] = [];
|
|
32
|
-
isPageErrorTest = false;
|
|
33
|
-
metrics!: Partial<Metrics>;
|
|
34
|
-
tagDataClass = '';
|
|
35
|
-
odataQuery = '';
|
|
36
|
-
processing = false;
|
|
37
|
-
errorStatus = '';
|
|
38
|
-
errorStatusClass = 'hidden';
|
|
39
|
-
status = { text: 'processing...', class: 'alert alert-danger' };
|
|
40
|
-
|
|
41
|
-
constructor(
|
|
42
|
-
private readonly cd: ChangeDetectorRef,
|
|
43
|
-
private http: HttpClient
|
|
44
|
-
) {
|
|
45
|
-
this.backendService = new GridOdataService();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
ngOnInit(): void {
|
|
49
|
-
this.initializeGrid();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
53
|
-
this.angularGrid = angularGrid;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
initializeGrid() {
|
|
57
|
-
this.columnDefinitions = [
|
|
58
|
-
{
|
|
59
|
-
id: 'name',
|
|
60
|
-
name: 'Name',
|
|
61
|
-
field: 'name',
|
|
62
|
-
sortable: true,
|
|
63
|
-
filterable: true,
|
|
64
|
-
filter: { model: Filters.compoundInput },
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
id: 'gender',
|
|
68
|
-
name: 'Gender',
|
|
69
|
-
field: 'gender',
|
|
70
|
-
filterable: true,
|
|
71
|
-
sortable: true,
|
|
72
|
-
filter: {
|
|
73
|
-
model: Filters.singleSelect,
|
|
74
|
-
collection: [
|
|
75
|
-
{ value: '', label: '' },
|
|
76
|
-
{ value: 'male', label: 'male' },
|
|
77
|
-
{ value: 'female', label: 'female' },
|
|
78
|
-
],
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
{ id: 'company', name: 'Company', field: 'company', filterable: true, sortable: true },
|
|
82
|
-
{
|
|
83
|
-
id: 'category_name',
|
|
84
|
-
name: 'Category',
|
|
85
|
-
field: 'category/name',
|
|
86
|
-
filterable: true,
|
|
87
|
-
sortable: true,
|
|
88
|
-
formatter: (_row, _cell, _val, _colDef, dataContext) => dataContext['category']?.['name'] || '',
|
|
89
|
-
},
|
|
90
|
-
];
|
|
91
|
-
|
|
92
|
-
this.gridOptions = {
|
|
93
|
-
enableAutoResize: true,
|
|
94
|
-
autoResize: {
|
|
95
|
-
container: '#demo-container',
|
|
96
|
-
rightPadding: 10,
|
|
97
|
-
},
|
|
98
|
-
checkboxSelector: {
|
|
99
|
-
// you can toggle these 2 properties to show the "select all" checkbox in different location
|
|
100
|
-
hideInFilterHeaderRow: false,
|
|
101
|
-
hideInColumnTitleRow: true,
|
|
102
|
-
},
|
|
103
|
-
enableCellNavigation: true,
|
|
104
|
-
enableFiltering: true,
|
|
105
|
-
enableCheckboxSelector: true,
|
|
106
|
-
enableRowSelection: true,
|
|
107
|
-
enableGrouping: true,
|
|
108
|
-
headerMenu: {
|
|
109
|
-
hideFreezeColumnsCommand: false,
|
|
110
|
-
},
|
|
111
|
-
presets: {
|
|
112
|
-
// NOTE: pagination preset is NOT supported with infinite scroll
|
|
113
|
-
// filters: [{ columnId: 'gender', searchTerms: ['female'] }]
|
|
114
|
-
},
|
|
115
|
-
backendServiceApi: {
|
|
116
|
-
service: this.backendService,
|
|
117
|
-
options: {
|
|
118
|
-
// enable infinite via Boolean OR via { fetchSize: number }
|
|
119
|
-
infiniteScroll: { fetchSize: 30 }, // or use true, in that case it would use default size of 25
|
|
120
|
-
enableCount: true,
|
|
121
|
-
version: 4,
|
|
122
|
-
},
|
|
123
|
-
onError: (error: Error) => {
|
|
124
|
-
this.errorStatus = error.message;
|
|
125
|
-
this.errorStatusClass = 'visible notification is-light is-danger is-small is-narrow';
|
|
126
|
-
this.displaySpinner(false, true);
|
|
127
|
-
},
|
|
128
|
-
preProcess: () => {
|
|
129
|
-
this.errorStatus = '';
|
|
130
|
-
this.errorStatusClass = 'hidden';
|
|
131
|
-
this.displaySpinner(true);
|
|
132
|
-
},
|
|
133
|
-
process: (query) => this.getCustomerApiCall(query),
|
|
134
|
-
postProcess: (response) => {
|
|
135
|
-
this.metrics = response.metrics;
|
|
136
|
-
this.displaySpinner(false);
|
|
137
|
-
this.getCustomerCallback(response);
|
|
138
|
-
this.cd.detectChanges();
|
|
139
|
-
},
|
|
140
|
-
// we could use local in-memory Filtering (please note that it only filters against what is currently loaded)
|
|
141
|
-
// that is when we want to avoid reloading the entire dataset every time
|
|
142
|
-
// useLocalFiltering: true,
|
|
143
|
-
} as OdataServiceApi,
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
displaySpinner(isProcessing: boolean, isError?: boolean) {
|
|
148
|
-
this.processing = isProcessing;
|
|
149
|
-
if (isError) {
|
|
150
|
-
this.status = { text: 'ERROR!!!', class: 'alert alert-danger' };
|
|
151
|
-
} else {
|
|
152
|
-
this.status = isProcessing ? { text: 'loading', class: 'alert alert-warning' } : { text: 'finished', class: 'alert alert-success' };
|
|
153
|
-
}
|
|
154
|
-
this.cd.detectChanges();
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
getCustomerCallback(data: { '@odata.count': number; infiniteScrollBottomHit: boolean; metrics: Metrics; query: string; value: any[] }) {
|
|
158
|
-
// totalItems property needs to be filled for pagination to work correctly
|
|
159
|
-
// however we need to force a dirty check, doing a clone object will do just that
|
|
160
|
-
const totalItemCount: number = data['@odata.count'];
|
|
161
|
-
this.metrics.totalItemCount = totalItemCount;
|
|
162
|
-
|
|
163
|
-
// even if we're not showing pagination, it is still used behind the scene to fetch next set of data (next page basically)
|
|
164
|
-
// once pagination totalItems is filled, we can update the dataset
|
|
165
|
-
|
|
166
|
-
// infinite scroll has an extra data property to determine if we hit an infinite scroll and there's still more data (in that case we need append data)
|
|
167
|
-
// or if we're on first data fetching (no scroll bottom ever occured yet)
|
|
168
|
-
if (!data.infiniteScrollBottomHit) {
|
|
169
|
-
// initial load not scroll hit yet, full dataset assignment
|
|
170
|
-
this.angularGrid.slickGrid?.scrollTo(0); // scroll back to top to avoid unwanted onScroll end triggered
|
|
171
|
-
this.dataset = data.value;
|
|
172
|
-
this.metrics.itemCount = data.value.length;
|
|
173
|
-
} else {
|
|
174
|
-
// scroll hit, for better perf we can simply use the DataView directly for better perf (which is better compare to replacing the entire dataset)
|
|
175
|
-
this.angularGrid.dataView?.addItems(data.value);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
this.odataQuery = data['query'];
|
|
179
|
-
|
|
180
|
-
// NOTE: you can get currently loaded item count via the `onRowCountChanged`slick event, see `refreshMetrics()` below
|
|
181
|
-
// OR you could also calculate it yourself or get it via: `this.sgb.dataView.getItemCount() === totalItemCount`
|
|
182
|
-
// console.log('is data fully loaded: ', this.sgb.dataView?.getItemCount() === totalItemCount);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
getCustomerApiCall(query: string) {
|
|
186
|
-
// in your case, you will call your WebAPI function (wich needs to return a Promise)
|
|
187
|
-
// for the demo purpose, we will call a mock WebAPI function
|
|
188
|
-
return this.getCustomerDataApiMock(query);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* This function is only here to mock a WebAPI call (since we are using a JSON file for the demo)
|
|
193
|
-
* in your case the getCustomer() should be a WebAPI function returning a Promise
|
|
194
|
-
*/
|
|
195
|
-
getCustomerDataApiMock(query: string): Promise<any> {
|
|
196
|
-
this.errorStatusClass = 'hidden';
|
|
197
|
-
|
|
198
|
-
// the mock is returning a Promise, just like a WebAPI typically does
|
|
199
|
-
return new Promise((resolve) => {
|
|
200
|
-
const queryParams = query.toLowerCase().split('&');
|
|
201
|
-
let top = 0;
|
|
202
|
-
let skip = 0;
|
|
203
|
-
let orderBy = '';
|
|
204
|
-
let countTotalItems = 100;
|
|
205
|
-
const columnFilters: any = {};
|
|
206
|
-
|
|
207
|
-
if (this.isPageErrorTest) {
|
|
208
|
-
this.isPageErrorTest = false;
|
|
209
|
-
throw new Error('Server timed out trying to retrieve data for the last page');
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
for (const param of queryParams) {
|
|
213
|
-
if (param.includes('$top=')) {
|
|
214
|
-
top = +param.substring('$top='.length);
|
|
215
|
-
if (top === 50000) {
|
|
216
|
-
throw new Error('Server timed out retrieving 50,000 rows');
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
if (param.includes('$skip=')) {
|
|
220
|
-
skip = +param.substring('$skip='.length);
|
|
221
|
-
}
|
|
222
|
-
if (param.includes('$orderby=')) {
|
|
223
|
-
orderBy = param.substring('$orderby='.length);
|
|
224
|
-
}
|
|
225
|
-
if (param.includes('$filter=')) {
|
|
226
|
-
const filterBy = param.substring('$filter='.length).replace('%20', ' ');
|
|
227
|
-
if (filterBy.includes('matchespattern')) {
|
|
228
|
-
const regex = new RegExp(`matchespattern\\(([a-zA-Z]+),\\s'${CARET_HTML_ESCAPED}(.*?)'\\)`, 'i');
|
|
229
|
-
const filterMatch = filterBy.match(regex) || [];
|
|
230
|
-
const fieldName = filterMatch[1].trim();
|
|
231
|
-
columnFilters[fieldName] = { type: 'matchespattern', term: '^' + filterMatch[2].trim() };
|
|
232
|
-
}
|
|
233
|
-
if (filterBy.includes('contains')) {
|
|
234
|
-
const filterMatch = filterBy.match(/contains\(([a-zA-Z/]+),\s?'(.*?)'/) || [];
|
|
235
|
-
const fieldName = filterMatch[1].trim();
|
|
236
|
-
columnFilters[fieldName] = { type: 'substring', term: filterMatch[2].trim() };
|
|
237
|
-
}
|
|
238
|
-
if (filterBy.includes('substringof')) {
|
|
239
|
-
const filterMatch = filterBy.match(/substringof\('(.*?)',\s([a-zA-Z/]+)/) || [];
|
|
240
|
-
const fieldName = filterMatch[2].trim();
|
|
241
|
-
columnFilters[fieldName] = { type: 'substring', term: filterMatch[1].trim() };
|
|
242
|
-
}
|
|
243
|
-
for (const operator of ['eq', 'ne', 'le', 'lt', 'gt', 'ge']) {
|
|
244
|
-
if (filterBy.includes(operator)) {
|
|
245
|
-
const re = new RegExp(`([a-zA-Z ]*) ${operator} '(.*?)'`);
|
|
246
|
-
const filterMatch = re.exec(filterBy);
|
|
247
|
-
if (Array.isArray(filterMatch)) {
|
|
248
|
-
const fieldName = filterMatch[1].trim();
|
|
249
|
-
columnFilters[fieldName] = { type: operator, term: filterMatch[2].trim() };
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
if (filterBy.includes('startswith') && filterBy.includes('endswith')) {
|
|
254
|
-
const filterStartMatch = filterBy.match(/startswith\(([a-zA-Z ]*),\s?'(.*?)'/) || [];
|
|
255
|
-
const filterEndMatch = filterBy.match(/endswith\(([a-zA-Z ]*),\s?'(.*?)'/) || [];
|
|
256
|
-
const fieldName = filterStartMatch[1].trim();
|
|
257
|
-
columnFilters[fieldName] = { type: 'starts+ends', term: [filterStartMatch[2].trim(), filterEndMatch[2].trim()] };
|
|
258
|
-
} else if (filterBy.includes('startswith')) {
|
|
259
|
-
const filterMatch = filterBy.match(/startswith\(([a-zA-Z ]*),\s?'(.*?)'/) || [];
|
|
260
|
-
const fieldName = filterMatch[1].trim();
|
|
261
|
-
columnFilters[fieldName] = { type: 'starts', term: filterMatch[2].trim() };
|
|
262
|
-
} else if (filterBy.includes('endswith')) {
|
|
263
|
-
const filterMatch = filterBy.match(/endswith\(([a-zA-Z ]*),\s?'(.*?)'/) || [];
|
|
264
|
-
const fieldName = filterMatch[1].trim();
|
|
265
|
-
columnFilters[fieldName] = { type: 'ends', term: filterMatch[2].trim() };
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// simular a backend error when trying to sort on the "Company" field
|
|
269
|
-
if (filterBy.includes('company')) {
|
|
270
|
-
throw new Error('Server could not filter using the field "Company"');
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// simulate a backend error when trying to sort on the "Company" field
|
|
276
|
-
if (orderBy.includes('company')) {
|
|
277
|
-
throw new Error('Server could not sort using the field "Company"');
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
this.http.get(`${sampleDataRoot}/customers_100.json`).subscribe((response) => {
|
|
281
|
-
let data = response as any[];
|
|
282
|
-
// Sort the data
|
|
283
|
-
if (orderBy?.length > 0) {
|
|
284
|
-
const orderByClauses = orderBy.split(',');
|
|
285
|
-
for (const orderByClause of orderByClauses) {
|
|
286
|
-
const orderByParts = orderByClause.split(' ');
|
|
287
|
-
const orderByField = orderByParts[0];
|
|
288
|
-
|
|
289
|
-
let selector = (obj: any): string => obj;
|
|
290
|
-
for (const orderByFieldPart of orderByField.split('/')) {
|
|
291
|
-
const prevSelector = selector;
|
|
292
|
-
selector = (obj: any) => {
|
|
293
|
-
return prevSelector(obj)[orderByFieldPart as any];
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
const sort = orderByParts[1] ?? 'asc';
|
|
298
|
-
switch (sort.toLocaleLowerCase()) {
|
|
299
|
-
case 'asc':
|
|
300
|
-
data = data.sort((a, b) => selector(a).localeCompare(selector(b)));
|
|
301
|
-
break;
|
|
302
|
-
case 'desc':
|
|
303
|
-
data = data.sort((a, b) => selector(b).localeCompare(selector(a)));
|
|
304
|
-
break;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
// Read the result field from the JSON response.
|
|
310
|
-
let firstRow = skip;
|
|
311
|
-
let filteredData = data;
|
|
312
|
-
if (columnFilters) {
|
|
313
|
-
for (const columnId in columnFilters) {
|
|
314
|
-
if (columnId in columnFilters) {
|
|
315
|
-
filteredData = filteredData.filter((column) => {
|
|
316
|
-
const filterType = columnFilters[columnId].type;
|
|
317
|
-
const searchTerm = columnFilters[columnId].term;
|
|
318
|
-
let colId = columnId;
|
|
319
|
-
if (columnId?.indexOf(' ') !== -1) {
|
|
320
|
-
const splitIds = columnId.split(' ');
|
|
321
|
-
colId = splitIds[splitIds.length - 1];
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
let filterTerm;
|
|
325
|
-
let col = column;
|
|
326
|
-
for (const part of colId.split('/')) {
|
|
327
|
-
filterTerm = col[part];
|
|
328
|
-
col = filterTerm;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
if (filterTerm) {
|
|
332
|
-
const [term1, term2] = Array.isArray(searchTerm) ? searchTerm : [searchTerm];
|
|
333
|
-
|
|
334
|
-
switch (filterType) {
|
|
335
|
-
case 'eq':
|
|
336
|
-
return filterTerm.toLowerCase() === term1;
|
|
337
|
-
case 'ne':
|
|
338
|
-
return filterTerm.toLowerCase() !== term1;
|
|
339
|
-
case 'le':
|
|
340
|
-
return filterTerm.toLowerCase() <= term1;
|
|
341
|
-
case 'lt':
|
|
342
|
-
return filterTerm.toLowerCase() < term1;
|
|
343
|
-
case 'gt':
|
|
344
|
-
return filterTerm.toLowerCase() > term1;
|
|
345
|
-
case 'ge':
|
|
346
|
-
return filterTerm.toLowerCase() >= term1;
|
|
347
|
-
case 'ends':
|
|
348
|
-
return filterTerm.toLowerCase().endsWith(term1);
|
|
349
|
-
case 'starts':
|
|
350
|
-
return filterTerm.toLowerCase().startsWith(term1);
|
|
351
|
-
case 'starts+ends':
|
|
352
|
-
return filterTerm.toLowerCase().startsWith(term1) && filterTerm.toLowerCase().endsWith(term2);
|
|
353
|
-
case 'substring':
|
|
354
|
-
return filterTerm.toLowerCase().includes(term1);
|
|
355
|
-
case 'matchespattern':
|
|
356
|
-
return new RegExp((term1 as string).replaceAll(PERCENT_HTML_ESCAPED, '.*'), 'i').test(filterTerm);
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
countTotalItems = filteredData.length;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
// make sure page skip is not out of boundaries, if so reset to first page & remove skip from query
|
|
366
|
-
if (firstRow > filteredData.length) {
|
|
367
|
-
query = query.replace(`$skip=${firstRow}`, '');
|
|
368
|
-
firstRow = 0;
|
|
369
|
-
}
|
|
370
|
-
const updatedData = filteredData.slice(firstRow, firstRow + top);
|
|
371
|
-
|
|
372
|
-
setTimeout(() => {
|
|
373
|
-
const backendResult: any = { query };
|
|
374
|
-
backendResult['value'] = updatedData;
|
|
375
|
-
backendResult['@odata.count'] = countTotalItems;
|
|
376
|
-
|
|
377
|
-
// console.log('Backend Result', backendResult);
|
|
378
|
-
resolve(backendResult);
|
|
379
|
-
}, 100);
|
|
380
|
-
});
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
groupByGender() {
|
|
385
|
-
this.angularGrid?.dataView?.setGrouping({
|
|
386
|
-
getter: 'gender',
|
|
387
|
-
formatter: (g) => `Gender: ${g.value} <span class="text-green">(${g.count} items)</span>`,
|
|
388
|
-
comparer: (a, b) => SortComparers.string(a.value, b.value),
|
|
389
|
-
aggregators: [new Aggregators.Sum('gemder')],
|
|
390
|
-
aggregateCollapsed: false,
|
|
391
|
-
lazyTotalsCalculation: true,
|
|
392
|
-
} as Grouping);
|
|
393
|
-
|
|
394
|
-
// you need to manually add the sort icon(s) in UI
|
|
395
|
-
this.angularGrid?.slickGrid.setSortColumns([{ columnId: 'duration', sortAsc: true }]);
|
|
396
|
-
this.angularGrid?.slickGrid.invalidate(); // invalidate all rows and re-render
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
clearAllFiltersAndSorts() {
|
|
400
|
-
if (this.angularGrid?.gridService) {
|
|
401
|
-
this.angularGrid.gridService.clearAllFiltersAndSorts();
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
setFiltersDynamically() {
|
|
406
|
-
// we can Set Filters Dynamically (or different filters) afterward through the FilterService
|
|
407
|
-
this.angularGrid?.filterService.updateFilters([{ columnId: 'gender', searchTerms: ['female'] }]);
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
refreshMetrics(args: OnRowCountChangedEventArgs) {
|
|
411
|
-
if (args?.current >= 0) {
|
|
412
|
-
this.metrics.itemCount = this.angularGrid.dataView?.getFilteredItemCount() || 0;
|
|
413
|
-
this.tagDataClass = this.metrics.itemCount === this.metrics.totalItemCount ? 'fully-loaded' : 'partial-load';
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
setSortingDynamically() {
|
|
418
|
-
this.angularGrid?.sortService.updateSorting([{ columnId: 'name', direction: 'DESC' }]);
|
|
419
|
-
}
|
|
420
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
<div class="demo39">
|
|
2
|
-
<h2>
|
|
3
|
-
Example 39: GraphQL Backend Service with Infinite Scroll
|
|
4
|
-
<span class="float-end">
|
|
5
|
-
<a
|
|
6
|
-
style="font-size: 18px"
|
|
7
|
-
target="_blank"
|
|
8
|
-
href="https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-infinite-graphql.component.ts"
|
|
9
|
-
>
|
|
10
|
-
<span class="mdi mdi-link-variant"></span> code
|
|
11
|
-
</a>
|
|
12
|
-
</span>
|
|
13
|
-
</h2>
|
|
14
|
-
|
|
15
|
-
<h6 class="title is-6 italic content">
|
|
16
|
-
<ul>
|
|
17
|
-
<li>
|
|
18
|
-
Infinite scrolling allows the grid to lazy-load rows from the server when reaching the scroll bottom (end) position. In its simplest
|
|
19
|
-
form, the more the user scrolls down, the more rows get loaded. If we reached the end of the dataset and there is no more data to
|
|
20
|
-
load, then we'll assume to have the entire dataset loaded in memory. This contrast with the regular Pagination approach which will
|
|
21
|
-
hold only hold data for 1 page at a time.
|
|
22
|
-
</li>
|
|
23
|
-
<li>NOTES</li>
|
|
24
|
-
<ol>
|
|
25
|
-
<li>
|
|
26
|
-
<code>presets.pagination</code> is not supported with Infinite Scroll and will revert to the first page, simply because since we
|
|
27
|
-
keep appending data, we always have to start from index zero (no offset).
|
|
28
|
-
</li>
|
|
29
|
-
<li>
|
|
30
|
-
Pagination is not shown BUT in fact, that is what is being used behind the scene whenever reaching the scroll end (fetching next
|
|
31
|
-
batch).
|
|
32
|
-
</li>
|
|
33
|
-
<li>Also note that whenever the user changes the Sort(s)/Filter(s) it will always reset and go back to zero index (first page).</li>
|
|
34
|
-
</ol>
|
|
35
|
-
</ul>
|
|
36
|
-
</h6>
|
|
37
|
-
|
|
38
|
-
<div class="row">
|
|
39
|
-
<div class="col-sm-5">
|
|
40
|
-
<div [class]="status.class" role="alert" data-test="status">
|
|
41
|
-
<strong>Status: </strong> {{ status.text }}
|
|
42
|
-
<span [hidden]="!processing">
|
|
43
|
-
<i class="mdi mdi-sync mdi-spin-1s"></i>
|
|
44
|
-
</span>
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
<div class="row">
|
|
48
|
-
<div class="col-md-12">
|
|
49
|
-
<button
|
|
50
|
-
class="btn btn-outline-secondary btn-sm btn-icon"
|
|
51
|
-
data-test="clear-filters-sorting"
|
|
52
|
-
(click)="clearAllFiltersAndSorts()"
|
|
53
|
-
title="Clear all Filters & Sorts"
|
|
54
|
-
>
|
|
55
|
-
<i class="mdi mdi-filter-remove-outline"></i>
|
|
56
|
-
Clear all Filter & Sorts
|
|
57
|
-
</button>
|
|
58
|
-
<label for="serverdelay" class="ml-4">Server Delay: </label>
|
|
59
|
-
<input
|
|
60
|
-
id="serverdelay"
|
|
61
|
-
type="number"
|
|
62
|
-
data-test="server-delay"
|
|
63
|
-
style="width: 55px"
|
|
64
|
-
[(ngModel)]="serverWaitDelay"
|
|
65
|
-
title="input a fake timer delay to simulate slow server response"
|
|
66
|
-
/>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
<div class="row mt-1">
|
|
70
|
-
<div class="col-md-12">
|
|
71
|
-
<button class="btn btn-outline-secondary btn-sm btn-icon" data-test="language-button" (click)="switchLanguage()">
|
|
72
|
-
<i class="mdi mdi-translate"></i>
|
|
73
|
-
Switch Language
|
|
74
|
-
</button>
|
|
75
|
-
<strong>Locale:</strong>
|
|
76
|
-
<span style="font-style: italic" data-test="selected-locale">
|
|
77
|
-
{{ selectedLanguage + '.json' }}
|
|
78
|
-
</span>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
<br />
|
|
82
|
-
<div *ngIf="metrics" style="margin: 10px 0px">
|
|
83
|
-
<b>Metrics:</b>
|
|
84
|
-
<span>
|
|
85
|
-
<span>{{ metrics.endTime | date: 'dd MMM, h:mm:ssa' }}</span> —
|
|
86
|
-
<span data-test="itemCount">{{ metrics.itemCount }}</span>
|
|
87
|
-
of
|
|
88
|
-
<span data-test="totalItemCount">{{ metrics.totalItemCount }}</span>
|
|
89
|
-
items
|
|
90
|
-
</span>
|
|
91
|
-
<span class="badge rounded-pill text-bg-primary" [class]="tagDataClass" data-test="data-loaded-tag">All Data Loaded!!!</span>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
<div class="col-sm-7">
|
|
96
|
-
<div class="alert alert-info" data-test="alert-graphql-query">
|
|
97
|
-
<strong>GraphQL Query:</strong>
|
|
98
|
-
<div [innerHTML]="graphqlQuery" data-test="graphql-query-result"></div>
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
|
|
103
|
-
<angular-slickgrid
|
|
104
|
-
gridId="grid39"
|
|
105
|
-
[columns]="columnDefinitions"
|
|
106
|
-
[options]="gridOptions"
|
|
107
|
-
[dataset]="dataset"
|
|
108
|
-
(onAngularGridCreated)="angularGridReady($event.detail)"
|
|
109
|
-
(onRowCountChanged)="refreshMetrics($event.detail.args)"
|
|
110
|
-
>
|
|
111
|
-
</angular-slickgrid>
|
|
112
|
-
</div>
|