|
6 | 6 | - [How to add Translation](#how-to-add-translation) |
7 | 7 | - [How to filter empty values](#how-to-filter-empty-values) |
8 | 8 | - Collection Options |
9 | | - - [Add Blank Entry](#collection-add-blank-entry) |
10 | | - - [Add Custom Entry at Beginning/End of Collection](#collection-add-custom-entry-at-the-beginningend-of-the-collection) |
11 | | - - [Custom Structure](#custom-structure-keylabel-pair) |
12 | | - - [Custom Structure with Translation](#custom-structure-with-translation) |
13 | | - - [Collection filterBy/sortBy](#collection-filterbysortby) |
14 | | - - [Collection Label Prefix/Suffix](#collection-label-prefixsuffix) |
15 | | - - [Collection Label Render HTML](#collection-label-render-html) |
16 | | - - [Collection Async Load](#collection-async-load) |
17 | | - - [Collection Watch](#collection-watch) |
| 9 | + - [Add Blank Entry](#collection-add-blank-entry) |
| 10 | + - [Add Custom Entry at Beginning/End of Collection](#collection-add-custom-entry-at-the-beginningend-of-the-collection) |
| 11 | + - [Custom Structure](#custom-structure-keylabel-pair) |
| 12 | + - [Custom Structure with Translation](#custom-structure-with-translation) |
| 13 | + - [Collection filterBy/sortBy](#collection-filterbysortby) |
| 14 | + - [Collection Label Prefix/Suffix](#collection-label-prefixsuffix) |
| 15 | + - [Collection Label Render HTML](#collection-label-render-html) |
| 16 | + - [Collection Async Load](#collection-async-load) |
| 17 | + - [Collection Lazy Load](#collection-lazy-load) |
| 18 | + - [Collection Watch](#collection-watch) |
18 | 19 | - [`multiple-select.js` Options](#multiple-selectjs-options) |
19 | 20 | - [Filter Options (`MultipleSelectOption` interface)](#filter-options-multipleselectoption-interface) |
20 | 21 | - [Display shorter selected label text](#display-shorter-selected-label-text) |
@@ -539,6 +540,24 @@ For example |
539 | 540 | } |
540 | 541 | ``` |
541 | 542 |
|
| 543 | +### Collection Lazy Load |
| 544 | +In some cases, you might have a grid with a lot of columns and loading the collection only after opening the select dropdown (or never in some cases) might help speeding up the initial grid loading. So for that use case, defining a `collectionLazy` callback can help. |
| 545 | + |
| 546 | +#### Load the collection through an Http callback |
| 547 | + |
| 548 | +```ts |
| 549 | +this.columnDefinitions = [ |
| 550 | + { |
| 551 | + id: 'prerequisites', name: 'Prerequisites', field: 'prerequisites', |
| 552 | + filterable: true, |
| 553 | + filter: { |
| 554 | + collectionLazy: (col: Column) => this.http.fetch('api/data/pre-requisites'), |
| 555 | + model: Filters.multipleSelect, |
| 556 | + } |
| 557 | + } |
| 558 | +]; |
| 559 | +``` |
| 560 | + |
542 | 561 | ### Collection Watch |
543 | 562 | We can enable the collection watch via the column filter `enableCollectionWatch` flag, or if you use a `collectionAsync` then this will be enabled by default. The collection watch will basically watch for any changes applied to the collection (any mutation changes like `push`, `pop`, `unshift`, ...) and will also watch for the `filter.collection` array replace, when any changes happens then it will re-render the Select Filter with the updated collection list. |
544 | 563 |
|
|
0 commit comments