Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
ng-cdk-table-virtual-scroll
Advanced tools
An Angular Directive, which allow to use virtual scrolling in cdk-table
This library is a fork of ng-table-virtual-scroll
NPM
$ npm install -save ng-cdk-table-virtual-scroll
TableVirtualScrollModule
import { TableVirtualScrollModule } from 'ng-cdk-table-virtual-scroll';
@NgModule({
imports: [
// ...
TableVirtualScrollModule
]
})
export class AppModule { }
Note: you need to install and configure virtual scrolling and mat-table before. TableVirtualScroll only make work them together properly
The TableVirtualScrollDataSource
extends the MatTableDataSource
and must be
used as the data source for the mat-table
Note: without TableVirtualScrollDataSource
the directive won't work
import { TableVirtualScrollDataSource } from 'ng-cdk-table-virtual-scroll';
@Component({...})
export class MyComponent {
dataSource = new TableVirtualScrollDataSource();
}
The tvsItemSize
directive makes the magic
<cdk-virtual-scroll-viewport tvsItemSize="48" headerHeight="56" style="height: 400px;">
<table mat-table [dataSource]="dataSource">
...
</table>
</cdk-virtual-scroll-viewport>
Make sure, you set the height to the <cdk-virtual-scroll-viewport>
container
Also, you can provide additional properties:
tvsItemSize
-> the row height in px (default: 48)
headerHeight
-> the header row height in px (default: 56)
footerHeight
-> the footer row height in px (default: 48)
headerEnabled
-> is the header row in the table (default: true)
footerEnabled
-> is the footer row in the table (default: false)
bufferMultiplier
-> the size of rendered buffer. The bufferMultiplier * visibleRowsCount
number of rows will be rendered before and after visible part of the table.
This project uses Angular CLI to build the package.
$ npm run build:lib ng-table-virtual-scroll
If you identify any errors in the library, or have an idea for an improvement, please open an issue.
FAQs
Virtual scroll for for Angular Cdk Table
We found that ng-cdk-table-virtual-scroll demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.