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,183 +0,0 @@
|
|
|
1
|
-
###### _requires Angular-Slickgrid >=5.0.0_
|
|
2
|
-
|
|
3
|
-
#### Index
|
|
4
|
-
- [Using `collection` or `collectionAsync`](#using-collection-or-collectionasync)
|
|
5
|
-
- [Filter Options (`AutocompleterOption` interface)](#filter-options-autocompleteroption-interface)
|
|
6
|
-
- [Using Remote API](#using-external-remote-api)
|
|
7
|
-
- [Force User Input](#autocomplete---force-user-input)
|
|
8
|
-
- [Update Filters Dynamically](../../column-functionalities/filters/input-filter.md#update-filters-dynamically)
|
|
9
|
-
- [Animated Gif Demo](#animated-gif-demo)
|
|
10
|
-
|
|
11
|
-
### Demo
|
|
12
|
-
[Demo Page](https://ghiscoding.github.io/angular-slickgrid-bs4-demo/#/editor) | [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-editor.component.ts)
|
|
13
|
-
|
|
14
|
-
### Introduction
|
|
15
|
-
AutoComplete is a functionality that let the user start typing characters and the autocomplete will try to give suggestions according to the characters entered. The collection can be a JSON files (collection of strings or objects) or can also be an external resource like a JSONP query to an external API. For a demo of what that could look like, take a look at the [animated gif demo](#animated-gif-demo) below.
|
|
16
|
-
|
|
17
|
-
We use an external lib named [Autocomplete](https://github.com/kraaden/autocomplete) (aka `autocompleter` on npm) by Kraaden.
|
|
18
|
-
|
|
19
|
-
## Using `collection` or `collectionAsync`
|
|
20
|
-
If you want to pass the entire list to the AutoComplete (like a JSON file or a Web API call), you can do so using the `collection` or the `collectionAsync` (the latter will load it asynchronously). You can also see that the Editor and Filter have almost the exact same configuration (apart from the `model` that is obviously different).
|
|
21
|
-
|
|
22
|
-
```html
|
|
23
|
-
<angular-slickgrid gridId="grid2"
|
|
24
|
-
[columns]="columnDefinitions"
|
|
25
|
-
[options]="gridOptions"
|
|
26
|
-
[dataset]="dataset">
|
|
27
|
-
</angular-slickgrid>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
##### Component
|
|
31
|
-
```typescript
|
|
32
|
-
import { Component, OnInit} from '@angular/core';
|
|
33
|
-
|
|
34
|
-
export class GridBasicComponent implements OnInit {
|
|
35
|
-
columnDefinitions: Column[];
|
|
36
|
-
gridOptions: GridOption;
|
|
37
|
-
dataset: any[];
|
|
38
|
-
|
|
39
|
-
ngOnInit(): void {
|
|
40
|
-
// your columns definition
|
|
41
|
-
this.columnDefinitions = [
|
|
42
|
-
{
|
|
43
|
-
id: 'countryOfOrigin', name: 'Country of Origin', field: 'countryOfOrigin',
|
|
44
|
-
formatter: Formatters.complexObject,
|
|
45
|
-
dataKey: 'code', // our list of objects has the structure { code: 'CA', name: 'Canada' }, since we want to use the code`, we will set the dataKey to "code"
|
|
46
|
-
labelKey: 'name', // while the displayed value is "name"
|
|
47
|
-
type: 'object',
|
|
48
|
-
sorter: Sorters.objectString, // since we have set dataKey to "code" our output type will be a string, and so we can use this objectString, this sorter always requires the dataKey
|
|
49
|
-
filterable: true,
|
|
50
|
-
sortable: true,
|
|
51
|
-
minWidth: 100,
|
|
52
|
-
editor: {
|
|
53
|
-
model: Editors.autocompleter,
|
|
54
|
-
customStructure: { label: 'name', value: 'code' },
|
|
55
|
-
collectionAsync: this.http.get('assets/data/countries.json'), // this demo will load the JSON file asynchronously
|
|
56
|
-
},
|
|
57
|
-
filter: {
|
|
58
|
-
model: Filters.autocompleter,
|
|
59
|
-
customStructure: { label: 'name', value: 'code' },
|
|
60
|
-
collectionAsync: this.http.get('assets/data/countries.json'),
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
];
|
|
64
|
-
|
|
65
|
-
this.gridOptions = {
|
|
66
|
-
// your grid options config
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Filter Options (`AutocompleterOption` interface)
|
|
73
|
-
All the available options that can be provided as filter `options` to your column definitions can be found under this [AutocompleterOption interface](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/interfaces/autocompleterOption.interface.ts) and you should cast your filter `options` to that interface to make sure that you use only valid options of the autocomplete library.
|
|
74
|
-
|
|
75
|
-
```ts
|
|
76
|
-
filter: {
|
|
77
|
-
model: Filters.autocompleter,
|
|
78
|
-
// previously known as `filterOptions` for < 9.0
|
|
79
|
-
options: {
|
|
80
|
-
minLength: 3,
|
|
81
|
-
} as AutocompleterOption
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
## Using External Remote API
|
|
86
|
-
You could also use external 3rd party Web API (can be JSONP query or regular JSON). This will make a much shorter result since it will only return a small subset of what will be displayed in the AutoComplete Editor or Filter. For example, we could use GeoBytes which provide a JSONP Query API for the cities of the world, you can imagine the entire list of cities would be way too big to download locally, so this is why we use such API.
|
|
87
|
-
|
|
88
|
-
#### Note
|
|
89
|
-
I don't have time to invest in finding how to use JSONP + CORS in Angular, if someone wants to submit a PR (Pull Request) with the proper Angular code, I would be happy to merge the code and update the Wiki. For now, I'll simply make a quick and easy example with the jQuery `$.ajax` call just for you to get the idea of how it works.
|
|
90
|
-
|
|
91
|
-
```html
|
|
92
|
-
<angular-slickgrid gridId="grid2"
|
|
93
|
-
[columns]="columnDefinitions"
|
|
94
|
-
[options]="gridOptions"
|
|
95
|
-
[dataset]="dataset">
|
|
96
|
-
</angular-slickgrid>
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
##### Component
|
|
100
|
-
```typescript
|
|
101
|
-
import { Component, OnInit} from '@angular/core';
|
|
102
|
-
|
|
103
|
-
export class GridBasicComponent implements OnInit {
|
|
104
|
-
columnDefinitions: Column[];
|
|
105
|
-
gridOptions: GridOption;
|
|
106
|
-
dataset: any[];
|
|
107
|
-
|
|
108
|
-
ngOnInit(): void {
|
|
109
|
-
// your columns definition
|
|
110
|
-
this.columnDefinitions = [
|
|
111
|
-
{
|
|
112
|
-
id: 'cityOfOrigin', name: 'City of Origin', field: 'cityOfOrigin',
|
|
113
|
-
filterable: true,
|
|
114
|
-
minWidth: 100,
|
|
115
|
-
editor: {
|
|
116
|
-
model: Editors.autocompleter,
|
|
117
|
-
placeholder: 'search city', // you can provide an optional placeholder to help your users
|
|
118
|
-
|
|
119
|
-
// use your own autocomplete options, instead of $.ajax, use http
|
|
120
|
-
// here we use $.ajax just because I'm not sure how to configure http with JSONP and CORS
|
|
121
|
-
// previously known as `filterOptions` for < 9.0
|
|
122
|
-
options: {
|
|
123
|
-
minLength: 3, // minimum count of character that the user needs to type before it queries to the remote
|
|
124
|
-
fetch: (searchText, updateCallback) => {
|
|
125
|
-
// assuming your API call returns a label/value pair
|
|
126
|
-
yourAsyncApiCall(searchText) // typically you'll want to return no more than 10 results
|
|
127
|
-
.then(result => updateCallback((results.length > 0) ? results : [{ label: 'No match found.', value: '' }]))
|
|
128
|
-
.catch(error => console.log('Error:', error));
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
filter: {
|
|
133
|
-
model: Filters.autocompleter,
|
|
134
|
-
// placeholder: '🔍 search city', // 🔍 is a search icon, this provide an option placeholder
|
|
135
|
-
|
|
136
|
-
// use your own autocomplete options, instead of $.ajax, use http
|
|
137
|
-
// here we use $.ajax just because I'm not sure how to configure http with JSONP and CORS
|
|
138
|
-
options: {
|
|
139
|
-
minLength: 3, // minimum count of character that the user needs to type before it queries to the remote
|
|
140
|
-
fetch: (searchText, updateCallback) => {
|
|
141
|
-
// assuming your API call returns a label/value pair
|
|
142
|
-
yourAsyncApiCall(searchText) // typically you'll want to return no more than 10 results
|
|
143
|
-
.then(result => updateCallback((results.length > 0) ? results : [{ label: 'No match found.', value: '' }]))
|
|
144
|
-
.catch(error => console.log('Error:', error));
|
|
145
|
-
},
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
];
|
|
150
|
-
|
|
151
|
-
this.gridOptions = {
|
|
152
|
-
// your grid options config
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
## Autocomplete - force user input
|
|
158
|
-
##### Requires version `2.6.0+`
|
|
159
|
-
If you want to add the autocomplete functionality but want the user to be able to input a new option, then follow the example below:
|
|
160
|
-
|
|
161
|
-
```ts
|
|
162
|
-
this.columnDefinitions = [{
|
|
163
|
-
id: 'area',
|
|
164
|
-
name: 'Area',
|
|
165
|
-
field: 'area',
|
|
166
|
-
editor: {
|
|
167
|
-
model: Editors.autocompleter,
|
|
168
|
-
// previously known as `filterOptions` for < 9.0
|
|
169
|
-
options: {
|
|
170
|
-
minLength: 0,
|
|
171
|
-
forceUserInput: true,
|
|
172
|
-
fetch: (searchText, updateCallback) => {
|
|
173
|
-
updateCallback(this.areas); // add here the array
|
|
174
|
-
},
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
];
|
|
179
|
-
```
|
|
180
|
-
You can also use the `minLength` to limit the autocomplete text to `0` characters or more, the default number is `3`.
|
|
181
|
-
|
|
182
|
-
## Animated Gif Demo
|
|
183
|
-

|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
#### index
|
|
2
|
-
- [Available Types](#available-types)
|
|
3
|
-
- [SASS Styling](#sass-styling)
|
|
4
|
-
- [Compound Input Filter](#how-to-use-compoundinput-filter)
|
|
5
|
-
- [Compound Date Filter](#how-to-use-compounddate-filter)
|
|
6
|
-
- [Compound Operator List (custom list)](#compound-operator-list-custom-list)
|
|
7
|
-
- [Compound Operator Alternate Texts](#compound-operator-alternate-texts)
|
|
8
|
-
- [Filter Complex Object](input-filter.md#how-to-filter-complex-objects)
|
|
9
|
-
- [Update Filters Dynamically](input-filter.md#update-filters-dynamically)
|
|
10
|
-
- [How to avoid filtering when only Operator dropdown is changed?](#how-to-avoid-filtering-when-only-operator-dropdown-is-changed)
|
|
11
|
-
- [Custom Filter Predicate](input-filter.md#custom-filter-predicate)
|
|
12
|
-
- [Filter Shortcuts](input-filter.md#filter-shortcuts)
|
|
13
|
-
|
|
14
|
-
### Description
|
|
15
|
-
Compound filters are a combination of 2 elements (Operator Select + Input Filter) used as a filter on a column. This is very useful to make it obvious to the user that there are Operator available and even more useful with a date picker (`Vanilla-Calendar`).
|
|
16
|
-
|
|
17
|
-
### Demo
|
|
18
|
-
[Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/clientside) / [Demo Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-clientside.component.ts)
|
|
19
|
-
|
|
20
|
-
### Available Types
|
|
21
|
-
There are multiple types of compound filters available
|
|
22
|
-
1. `Filters.compoundInputText` adds an Operator combine to an Input of type `text` (alias to `Filters.compoundInput`).
|
|
23
|
-
2. `Filters.compoundInputNumber` adds an Operator combine to an Input of type `number`.
|
|
24
|
-
3. `Filters.compoundInputPassword` adds an Operator combine to an Input of type `password.
|
|
25
|
-
4. `Filters.compoundDate` adds an Operator combine to a Date Picker.
|
|
26
|
-
5. `Filters.compoundSlider` adds an Operator combine to a Slider Filter.
|
|
27
|
-
|
|
28
|
-
### How to use CompoundInput Filter
|
|
29
|
-
Simply set the flag `filterable` to True and use the filter type `Filters.compoundInput`. Here is an example with a full column definition:
|
|
30
|
-
```ts
|
|
31
|
-
// define you columns, in this demo Effort Driven will use a Select Filter
|
|
32
|
-
this.columnDefinitions = [
|
|
33
|
-
{ id: 'title', name: 'Title', field: 'title' },
|
|
34
|
-
{ id: 'description', name: 'Description', field: 'description', filterable: true },
|
|
35
|
-
{ id: 'complete', name: '% Complete', field: 'percentComplete',
|
|
36
|
-
formatter: Formatters.percentCompleteBar,
|
|
37
|
-
type: 'number',
|
|
38
|
-
filterable: true,
|
|
39
|
-
filter: { model: Filters.compoundInput }
|
|
40
|
-
}
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
// you also need to enable the filters in the Grid Options
|
|
44
|
-
this.gridOptions = {
|
|
45
|
-
enableFiltering: true
|
|
46
|
-
};
|
|
47
|
-
```
|
|
48
|
-
#### Notes
|
|
49
|
-
The column definition `type` will affect the list of Operators shown, for example if you have `type: 'string'`, it will display the operators (`=`, `a*`, `*z`) where `a*` means StartsWith and `*z` means EndsWith. The current logic implemented is that any types that are not String, will display the list of Operators (` `, `=`, `<`, `<=`, `>`, `>=`, `<>`)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### How to use CompoundDate Filter
|
|
53
|
-
As any other columns, set the column definition flag `filterable: true` and use the filter type `Filters.compoundDate`. Here is an example with a full column definition:
|
|
54
|
-
|
|
55
|
-
```ts
|
|
56
|
-
// define you columns, in this demo Effort Driven will use a Select Filter
|
|
57
|
-
this.columnDefinitions = [
|
|
58
|
-
{ id: 'title', name: 'Title', field: 'title' },
|
|
59
|
-
{ id: 'description', name: 'Description', field: 'description', filterable: true },
|
|
60
|
-
{ id: 'usDateShort', name: 'US Date Short', field: 'usDateShort',
|
|
61
|
-
type: 'dateUsShort',
|
|
62
|
-
filterable: true,
|
|
63
|
-
filter: {
|
|
64
|
-
model: Filters.compoundDate,
|
|
65
|
-
|
|
66
|
-
// you can also add an optional placeholder
|
|
67
|
-
placeholder: 'filter by date'
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
];
|
|
71
|
-
|
|
72
|
-
// you also need to enable the filters in the Grid Options
|
|
73
|
-
this.gridOptions = {
|
|
74
|
-
enableFiltering: true
|
|
75
|
-
};
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
> **Note** we use [Tempo](https://tempo.formkit.com/) to parse and format Dates to the chosen format via the `type` option when provided in your column definition.
|
|
79
|
-
|
|
80
|
-
#### Dealing with different input/ouput dates (example: UTC)
|
|
81
|
-
What if your date input (from your dataset) has a different output on the screen (UI)?
|
|
82
|
-
In that case, you will most probably have a Formatter and type representing the input type, we also provided an `outputType` that can be used to deal with that case.
|
|
83
|
-
|
|
84
|
-
For example, if we have an input date in UTC format and we want to display a Date ISO format to the screen (UI) in the date picker.
|
|
85
|
-
|
|
86
|
-
```ts
|
|
87
|
-
// define you columns, in this demo Effort Driven will use a Select Filter
|
|
88
|
-
this.columnDefinitions = [
|
|
89
|
-
{ id: 'title', name: 'Title', field: 'title' },
|
|
90
|
-
{ id: 'description', name: 'Description', field: 'description', filterable: true },
|
|
91
|
-
{ id: 'utcDate', name: 'UTC Date', field: 'utcDate',
|
|
92
|
-
type: 'dateUtc', // format used in the dataset (input)
|
|
93
|
-
formatter: Formatters.dateTimeIso, // format to show in the cell on each row (formatter)
|
|
94
|
-
outputType: 'dateTimeIso', // format to show in the date picker
|
|
95
|
-
filterable: true, filter: { model: Filters.compoundDate }
|
|
96
|
-
}
|
|
97
|
-
];
|
|
98
|
-
|
|
99
|
-
// you also need to enable the filters in the Grid Options
|
|
100
|
-
this.gridOptions = {
|
|
101
|
-
enableFiltering: true
|
|
102
|
-
};
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
#### Date and Time
|
|
106
|
-
The date picker will automatically detect if the `type` or `outputType` has time inside, if it does then it will add a time picker at the bottom of the date picker.
|
|
107
|
-
|
|
108
|
-
For example, if we have an input date in UTC format and we want to display a Date ISO format with time to the screen (UI) and the date picker.
|
|
109
|
-
|
|
110
|
-
```ts
|
|
111
|
-
// define you columns, in this demo Effort Driven will use a Select Filter
|
|
112
|
-
this.columnDefinitions = [
|
|
113
|
-
{ id: 'title', name: 'Title', field: 'title' },
|
|
114
|
-
{ id: 'description', name: 'Description', field: 'description', filterable: true },
|
|
115
|
-
{ id: 'utcDate', name: 'UTC Date', field: 'utcDate', // if your type has hours/minutes, then the date picker will include date+time
|
|
116
|
-
type: 'dateUtc',
|
|
117
|
-
formatter: Formatters.dateTimeIsoAmPm,
|
|
118
|
-
outputType: 'dateTimeIsoAmPm',
|
|
119
|
-
filterable: true, filter: { model: Filters.compoundDate }
|
|
120
|
-
}
|
|
121
|
-
];
|
|
122
|
-
|
|
123
|
-
// you also need to enable the filters in the Grid Options
|
|
124
|
-
this.gridOptions = {
|
|
125
|
-
enableFiltering: true
|
|
126
|
-
};
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
#### Filter Options (`VanillaCalendarOption` interface)
|
|
130
|
-
All the available options that can be provided as filter `options` to your column definitions can be found under this [VanillaCalendarOption interface](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/interfaces/vanillaCalendarOption.interface.ts) and you should cast your filter `options` with the expected interface to make sure that you use only valid settings of the [Vanilla-Calendar](https://vanilla-calendar.pro/docs/reference/additionally/settings) library.
|
|
131
|
-
|
|
132
|
-
```ts
|
|
133
|
-
filter: {
|
|
134
|
-
model: Filters.compoundDate,
|
|
135
|
-
// previously known as `filterOptions` for < 9.0
|
|
136
|
-
options: {
|
|
137
|
-
displayDateMin: 'today'
|
|
138
|
-
} as VanillaCalendarOption
|
|
139
|
-
}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
#### Grid Option `defaultFilterOptions
|
|
143
|
-
You could also define certain options as a global level (for the entire grid or even all grids) by taking advantage of the `defaultFilterOptions` Grid Option. Note that they are set via the filter type as a key name (`autocompleter`, `date`, ...) and then the content is the same as filter `options` (also note that each key is already typed with the correct filter option interface), for example
|
|
144
|
-
|
|
145
|
-
```ts
|
|
146
|
-
this.gridOptions = {
|
|
147
|
-
defaultFilterOptions: {
|
|
148
|
-
// Note: that `date`, `select` and `slider` are combining both compound & range filters together
|
|
149
|
-
date: { displayDateMin: 'today' }, // typed as VanillaCalendarOption
|
|
150
|
-
select: { minHeight: 350 }, // typed as MultipleSelectOption
|
|
151
|
-
slider: { sliderStartValue: 10 }
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
### Compound Operator List (custom list)
|
|
157
|
-
Each Compound Filter will try to define the best possible Operator List depending on what Field Type you may have (for example we can have StartsWith Operator on a string but not on a number). If you want to provide your own custom Operator List to a Compound Filter, you can do that via the `compoundOperatorList` property (also note that your Operator must be a valid OperatorType/OperatorString).
|
|
158
|
-
|
|
159
|
-
```ts
|
|
160
|
-
this.columnDefinitions = [
|
|
161
|
-
{ id: 'title', name: 'Title', field: 'title' },
|
|
162
|
-
{ id: 'description', name: 'Description', field: 'description', filterable: true },
|
|
163
|
-
{ id: 'utcDate', name: 'UTC Date', field: 'utcDate',
|
|
164
|
-
type: 'dateUtc',
|
|
165
|
-
formatter: Formatters.dateTimeIsoAmPm,
|
|
166
|
-
outputType: 'dateTimeIsoAmPm',
|
|
167
|
-
filterable: true, filter: {
|
|
168
|
-
model: Filters.compoundSlider,
|
|
169
|
-
// here is our custom list that will override default list
|
|
170
|
-
compoundOperatorList: [
|
|
171
|
-
{ operator: '', desc: '' },
|
|
172
|
-
{ operator: '=', desc: 'Equal to' },
|
|
173
|
-
{ operator: '<', desc: 'Less than' },
|
|
174
|
-
{ operator: '>', desc: 'Greater than' },
|
|
175
|
-
]
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
];
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### Compound Operator Alternate Texts
|
|
182
|
-
You can change any of the compound operator text or description shown in the select dropdown list by using `compoundOperatorAltTexts` to provide alternate texts.
|
|
183
|
-
|
|
184
|
-
The texts are separated into 2 groups (`numeric` or `text`) so that the alternate texts can be applied to all assigned filters, hence the type will vary depending on which Filter you choose as shown below:
|
|
185
|
-
- `numeric`
|
|
186
|
-
- `Filters.compoundDate`
|
|
187
|
-
- `Filters.compoundInputNumber`
|
|
188
|
-
- `Filters.compoundSlider`
|
|
189
|
-
- `text`
|
|
190
|
-
- `Filters.compoundInput`
|
|
191
|
-
- `Filters.compoundInputPassword`
|
|
192
|
-
- `Filters.compoundInputText`
|
|
193
|
-
|
|
194
|
-
> **Note** avoid using text with more than 2 or 3 characters for the operator text (which is roughly the width of the compound operator select dropdown), exceeding this limit will require CSS style changes.
|
|
195
|
-
|
|
196
|
-
```ts
|
|
197
|
-
this.gridOptions = {
|
|
198
|
-
compoundOperatorAltTexts: {
|
|
199
|
-
// where '=' is any of the `OperatorString` type shown above
|
|
200
|
-
numeric: { '=': { operatorAlt: 'eq', descAlt: 'alternate numeric equal description' } },
|
|
201
|
-
text: { '=': { operatorAlt: 'eq', descAlt: 'alternate text equal description' } }
|
|
202
|
-
},
|
|
203
|
-
}
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-

|
|
207
|
-
|
|
208
|
-
### How to avoid filtering when only Operator dropdown is changed?
|
|
209
|
-
Starting with version `>=2.1.x`, you can now enable `skipCompoundOperatorFilterWithNullInput` that can be provided to your Grid Options (or via global grid options) and/or your Column Definition.
|
|
210
|
-
|
|
211
|
-
What will this option do really?
|
|
212
|
-
- skip filtering (in other words do nothing) will occur when:
|
|
213
|
-
- Operator select dropdown (left side) is changed without any value provided in the filter input (right).
|
|
214
|
-
- start filtering when:
|
|
215
|
-
- Operator select dropdown is changed **and** we have a value provided in the filter input, it will start filtering
|
|
216
|
-
- Operator select dropdown is empty **but** we have a value provided in the filter input, it will start filtering
|
|
217
|
-
|
|
218
|
-
> **Note** the Compound Date Filter is the only filter that has this option enabled by default.
|
|
219
|
-
|
|
220
|
-
###### Code
|
|
221
|
-
```ts
|
|
222
|
-
this.columnDefinitions = [{
|
|
223
|
-
id: 'name', field: 'name',
|
|
224
|
-
filter: {
|
|
225
|
-
model: Filters.compoundInput,
|
|
226
|
-
skipCompoundOperatorFilterWithNullInput: true // change via column def, always has higher specificity over grid options
|
|
227
|
-
}
|
|
228
|
-
}];
|
|
229
|
-
|
|
230
|
-
// or change for all compound filters of the same grid
|
|
231
|
-
this.gridOptions = {
|
|
232
|
-
skipCompoundOperatorFilterWithNullInput: true,
|
|
233
|
-
};
|
|
234
|
-
```
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
#### index
|
|
2
|
-
- [Filter Complex Object](input-filter.md#filter-complex-object)
|
|
3
|
-
- [Update Filters Dynamically](input-filter.md#update-filters-dynamically)
|
|
4
|
-
- [Custom Filter with Angular Components](#custom-filter-with-angular-components)
|
|
5
|
-
|
|
6
|
-
### Demo
|
|
7
|
-
##### with plain javascript/jQuery
|
|
8
|
-
[Demo Page](https://ghiscoding.github.io/Angular-Slickgrid/#/clientside) / [Demo Client Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-clientside.component.ts) / [Custom InputFilter.ts](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/custom-inputFilter.ts)
|
|
9
|
-
|
|
10
|
-
##### with Angular Component
|
|
11
|
-
[Demo](https://ghiscoding.github.io/Angular-Slickgrid/#/angular-components) / [Demo Client Component](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-angular.component.ts)
|
|
12
|
-
|
|
13
|
-
### Description
|
|
14
|
-
You can also create your own Custom Filter with any html/css you want and/or jQuery library you wish to use. Latest version now supports Custom Filter with Angular Component, see [Example 22](https://ghiscoding.github.io/Angular-Slickgrid/#/angular-components)
|
|
15
|
-
|
|
16
|
-
#### Limitations
|
|
17
|
-
- as mentioned in the description, only html/css and/or jQuery libraries are supported.
|
|
18
|
-
- this mainly mean that Angular templates (components) are not supported (feel free to contribute).
|
|
19
|
-
- SlickGrid uses `table-cell` as CSS for it to display a consistent height for each rows (this keeps the same row height/line-height to always be the same).
|
|
20
|
-
- all this to say that you might be in a situation were your filter shows in the back of the grid. The best approach to overcome this is to use a modal if you can or if the library support `append to body container`. For example, you can see that `multiple-select-vanilla` supports a `container`
|
|
21
|
-
|
|
22
|
-
### How to use Custom Filter?
|
|
23
|
-
1. You first need to create a `class` using the [Filter interface](https://github.com/ghiscoding/slickgrid-universal/blob/master/packages/common/src/interfaces/filter.interface.ts). Make sure to create all necessary public properties and functions.
|
|
24
|
-
- You can see a demo with a [custom-inputFilter.ts](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/custom-inputFilter.ts) that is used in the [demo - example 4](https://ghiscoding.github.io/Angular-Slickgrid/#/clientside)
|
|
25
|
-
2. Simply set the `columnDefinition.filter.model` to your new custom Filter class and instantiate it with `new` (you can also use dependency injection in the constructor if you wish). Here is an example with a custom input filter:
|
|
26
|
-
```typescript
|
|
27
|
-
// define you columns, in this demo Effort Driven will use a Select Filter
|
|
28
|
-
this.columnDefinitions = [
|
|
29
|
-
{ id: 'title', name: 'Title', field: 'title' },
|
|
30
|
-
{ id: 'description', name: 'Description', field: 'description',
|
|
31
|
-
filterable: true,
|
|
32
|
-
filter: {
|
|
33
|
-
model: CustomInputFilter // create a new instance to make each Filter independent from each other
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
];
|
|
37
|
-
|
|
38
|
-
// you also need to enable the filters in the Grid Options
|
|
39
|
-
this.gridOptions = {
|
|
40
|
-
enableFiltering: true
|
|
41
|
-
};
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Default Search Term(s)
|
|
45
|
-
If you want to load the grid with certain default filter(s), you can use the following optional properties:
|
|
46
|
-
- `searchTerms` (array of values)
|
|
47
|
-
|
|
48
|
-
For example, setting a default value into an `input` element, you can simply get the search term with `columnDef.filter.searchTerms` and set the default value in jquery with `$(filterElm).val(this.searchTerms);`
|
|
49
|
-
|
|
50
|
-
### Collection
|
|
51
|
-
If you want to pass a `collection` to your filter (for example, a multiple-select needs a select list of options), you can then use it in your custom filter through `columnDef.filter.collection`
|
|
52
|
-
|
|
53
|
-
#### `key/label` pair
|
|
54
|
-
By default a `collection` uses the `label/value` pair. You can loop through your `collection` and use the `label/value` properties. For example:
|
|
55
|
-
```typescript
|
|
56
|
-
// loop through collection to create select option
|
|
57
|
-
this.columnDef.filter.collection.forEach((option: SelectOption) => {
|
|
58
|
-
// use the option value & label
|
|
59
|
-
options += `<option value="${option.value}">${option.label}</option>`;
|
|
60
|
-
});
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
#### Custom Structure (key/label pair)
|
|
64
|
-
What if your `collection` have totally different value/label pair? In this case, you can use the `customStructure` to change the property name(s) to use. You can change the label and/or the value, they can be passed independently.
|
|
65
|
-
For example:
|
|
66
|
-
```typescript
|
|
67
|
-
// use custom structure value/label pair
|
|
68
|
-
const labelName = (this.columnDef.filter.customStructure) ? this.columnDef.filter.customStructure.label : 'label';
|
|
69
|
-
const valueName = (this.columnDef.filter.customStructure) ? this.columnDef.filter.customStructure.value : 'value';
|
|
70
|
-
|
|
71
|
-
this.columnDef.filter.collection.forEach((option: SelectOption) => {
|
|
72
|
-
// use the option value & translated label
|
|
73
|
-
options += `<option value="${option[valueName]}">${option[labelName]}</option>`;
|
|
74
|
-
});
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### How to add Translation?
|
|
78
|
-
|
|
79
|
-
#### LabelKey
|
|
80
|
-
By default a `collection` uses the `label/value` pair without translation or `labelKey/value` pair with translation usage. So if you want to use translations, then you can loop through your `collection` and use the `labelKey/value` properties. For example:
|
|
81
|
-
```typescript
|
|
82
|
-
this.columnDef.filter.collection.forEach((option: SelectOption) => {
|
|
83
|
-
// translate label
|
|
84
|
-
const textLabel = (option.labelKey && typeof this.i18n.tr === 'function') ? this.i18n.tr(option.labelKey || ' ') : option.labelKey;
|
|
85
|
-
|
|
86
|
-
// use the option value & translated label
|
|
87
|
-
options += `<option value="${option.value}">${textLabel}</option>`;
|
|
88
|
-
});
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Custom Structure with Translation
|
|
92
|
-
What if you want to use `customStructure` and translate the labels? Simply pass the flag `enableTranslateLabel: true`
|
|
93
|
-
|
|
94
|
-
For example:
|
|
95
|
-
```typescript
|
|
96
|
-
// use custom structure value/label pair
|
|
97
|
-
const labelName = (this.columnDef.filter.customStructure) ? this.columnDef.filter.customStructure.label : 'label';
|
|
98
|
-
const valueName = (this.columnDef.filter.customStructure) ? this.columnDef.filter.customStructure.value : 'value';
|
|
99
|
-
|
|
100
|
-
this.columnDef.filter.collection.forEach((option: SelectOption) => {
|
|
101
|
-
// translate label
|
|
102
|
-
const textLabel = (option.labelKey && typeof this.i18n.tr === 'function') ? this.i18n.tr(option[labelName] || ' ') : option[labelName];
|
|
103
|
-
|
|
104
|
-
// use the option value & translated label
|
|
105
|
-
options += `<option value="${option[valueName]}">${textLabel}</option>`;
|
|
106
|
-
});
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## Custom Filter with Angular Components
|
|
110
|
-
You can see them in [Example 22](https://ghiscoding.github.io/Angular-Slickgrid/#/angular-components) which have both Custom Editors & Filters which uses Angular Components. The 2nd column "Assignee" is the column that uses both (it uses `ng-select` 3rd party lib wrapped in an Angular Components [here](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/filter-ng-select.component.ts)) and you need to create a Custom Filter like [here](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/custom-angularComponentFilter.ts) and use that Custom Filter in your column definition like [here](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/grid-angular.component.ts#L109).
|
|
111
|
-
|
|
112
|
-
Personally I don't find this very straightforward and I don't recommend using Angular Components for Editors/Filters as it adds a lot of boilerplate (compare to 1 step with a jQuery Custom Filter) but if you really wish to go that route, it's now possible following the steps shown below.
|
|
113
|
-
|
|
114
|
-
The steps to use an Angular Component as a Custom Filter are the following:
|
|
115
|
-
1. Create a Custom Filter that will handle the creation or compilation of the Angular Component into a SlickGrid Editors. For that you can take a look at this [Custom Filter](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/custom-angularComponentFilter.ts)
|
|
116
|
-
2. Define your Angular Component, for example take a look at this simple [ng-select Filter](https://github.com/ghiscoding/slickgrid-universal/blob/master/frameworks/angular-slickgrid/src/demos/examples/filter-ng-select.component.ts)
|
|
117
|
-
3. Use the Custom Filter inside your Column Definitions, for that you can see previous paragraph [here](#how-to-use-custom-filter)
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
#### Index
|
|
2
|
-
- [How to use Filter?](#how-to-use-filter)
|
|
3
|
-
- [Filtering with Localization](input-filter.md#how-to-hide-filter-header-row)
|
|
4
|
-
- [Filtering with Localization](input-filter.md#filtering-with-localization-i18n)
|
|
5
|
-
- [Filter Complex Object](input-filter.md#how-to-filter-complex-objects)
|
|
6
|
-
- [Update Filters Dynamically](input-filter.md#update-filters-dynamically)
|
|
7
|
-
- [Query Different Field (Filter/Sort)](input-filter.md#query-different-field)
|
|
8
|
-
- [Dynamic Query Field](input-filter.md#dynamic-query-field)
|
|
9
|
-
- [Debounce/Throttle Text Search (wait for user to stop typing before filtering)](input-filter.md#debouncethrottle-text-search-wait-for-user-to-stop-typing-before-filtering)
|
|
10
|
-
- [Ignore Locale Accent in Text Filter/Sorting](input-filter.md#ignore-locale-accent-in-text-filtersorting)
|
|
11
|
-
- [Custom Filter Predicate](input-filter.md#custom-filter-predicate)
|
|
12
|
-
- [Filter Shortcuts](input-filter.md#filter-shortcuts)
|
|
13
|
-
|
|
14
|
-
### Description
|
|
15
|
-
|
|
16
|
-
Filtering is a big part of a data grid, Slickgrid-Universal provides a few built-in Filters that you can use in your grids. You need to tell the grid that you want to use Filtering (via Grid Options) and you also need to enable the filter for every column that you need filtering (via Column Definitions).
|
|
17
|
-
|
|
18
|
-
### How to use Filter?
|
|
19
|
-
You simply need to set the flag `filterable` for each column that you want filtering and then also enable the filters in the Grid Options. Here is an example with a full column definitions:
|
|
20
|
-
```ts
|
|
21
|
-
// define you columns, in this demo Effort Driven will use a Select Filter
|
|
22
|
-
this.columnDefinitions = [
|
|
23
|
-
{ id: 'title', name: 'Title', field: 'title' }, // without filter
|
|
24
|
-
{ id: 'description', name: 'Description', field: 'description', filterable: true } // with filter
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
// you also need to enable the filters in the Grid Options
|
|
28
|
-
this.gridOptions = {
|
|
29
|
-
enableFiltering: true
|
|
30
|
-
};
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### How to hide Filter Header Row?
|
|
34
|
-
There are 2 ways to hide Filters from the user, you could disable it completely OR you could hide the Filter Header Row.
|
|
35
|
-
|
|
36
|
-
##### You could disable the Filters completely,
|
|
37
|
-
```ts
|
|
38
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
39
|
-
this.angularGrid = angularGrid;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
disableFilters() {
|
|
43
|
-
this.gridOptions = {
|
|
44
|
-
enableFiltering: false
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// you could re-enable it later
|
|
48
|
-
this.angularGrid.setOptions({ enableFiltering: true });
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
##### You could also enable Filters but Hide them from the user in the UI
|
|
53
|
-
This can be useful for features that require Filtering but you wish to hide the filters for example Tree Data.
|
|
54
|
-
|
|
55
|
-
```ts
|
|
56
|
-
this.gridOptions = {
|
|
57
|
-
enableFiltering: true,
|
|
58
|
-
showHeaderRow: false,
|
|
59
|
-
};
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Also, if you don't want to see the Grid Menu toggle filter row command, you should also hide it from the menu via
|
|
63
|
-
|
|
64
|
-
```ts
|
|
65
|
-
angularGridReady(angularGrid: AngularGridInstance) {
|
|
66
|
-
this.angularGrid = angularGrid;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
hideFilterRow() {
|
|
70
|
-
this.gridOptions = {
|
|
71
|
-
enableFiltering: true,
|
|
72
|
-
showHeaderRow: false,
|
|
73
|
-
gridMenu: {
|
|
74
|
-
hideToggleFilterCommand: true
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// you can show toggle the filter header row dynamically
|
|
79
|
-
this.angularGrid.setHeaderRowVisibility(true);
|
|
80
|
-
}
|
|
81
|
-
```
|