Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
ng-table-virtual-scroll
Advanced tools
Changelog
Readme
An Angular Directive, which allow to use virtual scrolling in mat-table
NPM
$ npm install -save ng-table-virtual-scroll
Version compatibility
Angular version | Library version |
---|---|
>= 15 | latest |
13 - 14 | 1.5.* |
<= 12 | 1.3.* |
TableVirtualScrollModule
import { TableVirtualScrollModule } from 'ng-table-virtual-scroll';
@NgModule({
imports: [
// ...
TableVirtualScrollModule
]
})
export class AppModule { }
Note: you need to install and configure virtual scrolling (ScrollingModule) and mat-table (MatTableModule) before. TableVirtualScroll only make them work together properly
The TableVirtualScrollDataSource
extends the MatTableDataSource
and must be
used as the data source for the mat-table
(CdkTableVirtualScrollDataSource
for cdk-table
)
Note: without TableVirtualScrollDataSource
the directive won't work
import { TableVirtualScrollDataSource } from 'ng-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.
cdk-table
from CdkTableModule
is also supported. Just use CdkTableVirtualScrollDataSource
as datasource
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 Material Table
The npm package ng-table-virtual-scroll receives a total of 24,255 weekly downloads. As such, ng-table-virtual-scroll popularity was classified as popular.
We found that ng-table-virtual-scroll demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.