[Angular]: https://angular.io/ "Angular UI Framework" [Source]: https://github.com/rlexa/dd-virt-list "Source Code"
npm install dd-virt-list[Angular]: https://angular.io/ "Angular UI Framework"
[Source]: https://github.com/rlexa/dd-virt-list "Source Code"
DdVirtList ([Source]) is an [Angular] component for showing a virtual list for both large data arrays and lazy loaded chunks.
Embeds to be rendered items as ng-content and expects all items to have the same height.
Template:
``html`
`
Code:ts`
data = Array.from(Array(1000000), (ii, jj) => jj); // create array of numbers
Template:
`html`
`
Code:ts`
stream = new Subject<{from: number, to: number, items: any[]}>();
onLazy = (request: {from: number, to: number}) =>
// ... get lazy data page into 'data'
this.stream.next({ ...request, items: data });
| Setter | Default | Info |
| - | - | - |
| vlBatchSize | 30 | number Batch size hint used for page size calculation (min. 10). |string
| vlHeight | 'auto' | Height of the scrolling container (expects any valid CSS height). |number
| vlChildrenPerRow | 0 | If bigger than 0 then the content is expected to be a container of the actual list items (instead of being the list of items otherwise). |any[]
| vlData | null | For non-lazy data representation (auto-sets vlCount). |number
| vlCount | 0 | Set to total count for lazy data. |Observable
| vlTrigger | null | Can be used to trigger re-requesting data. |Observable<{from: number, to: number, items: any[]}>
| vlLazyStream | null | Used as source of lazy data. |boolean
| vlDebugMode | false | Logs some info when set to true. |
| Emitter | Info |
| - | - |
| vlLazyRequest | EventEmitter<{from: number, to: number, items: any[]}> Lazy data request stream. |
| Getter | Info |
| - | - |
| items | any[]` Current items the component provides for rendering. |
MIT