npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-datatable-footer

v4.0.4

Published

[![Build Status](https://travis-ci.org/ZhongruiGroup/ngx-datatable-footer.svg?branch=master)](https://travis-ci.org/ZhongruiGroup/ngx-datatable-footer) [![codecov](https://codecov.io/gh/ZhongruiGroup/ngx-datatable-footer/branch/master/graph/badge.svg)](ht

Downloads

492

Readme

ngx datatable footer

Build Status codecov npm version devDependency Status GitHub issues GitHub stars GitHub license

About

This is a footer component for extending'ngx-datatable'components.

Installation

Install through npm:

npm install --save ngx-datatable-footer

Then include in your apps module:

import { NgModule } from '@angular/core';
import { NgxDatatableFooterModule } from 'ngx-datatable-footer';

@NgModule({
  imports: [NgxDatatableFooterModule.forRoot()],
})
export class MyModule {}

Finally use in one of your apps components:

import { Component } from '@angular/core';

@Component({
  template: '<app-datatable-footer [datatable]="datatable"></app-datatable-footer>',
})
export class MyComponent {}

自定义模板

自定义页脚左侧

目前只支持全局修改页脚左侧 添加一个模板组件footer-page-statics

<ng-template
  #template
  let-rowCount="rowCount"
  let-pageSize="pageSize"
  let-selectedCount="selectedCount"
  let-curPage="curPage"
  let-offset="offset"
  let-config="config"
>
  <div
    class="page-count"
    *ngIf="rowCount > 0"
    [innerHTML]="
      '总数量' +
      rowCount +
      ' ' +
      config.labels.current +
      ((offset || 0) * pageSize + 1) +
      ' - ' +
      ((offset + 1) * pageSize > rowCount ? rowCount : (offset + 1 || 1) * pageSize) +
      ' / ' +
      rowCount +
      config.labels.line
    "
  ></div>
</ng-template>
import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
import { NgxDatatableFooterPageStatics } from 'ngx-datatable-footer/src/lib/models/footer.type';

@Component({
  selector: 'app-footer-page-statics',
  templateUrl: './footer-page-statics.component.html',
  styleUrls: ['./footer-page-statics.component.scss'],
})
export class FooterPageStaticsComponent implements OnInit, NgxDatatableFooterPageStatics {
  @ViewChild('template') templateRef: TemplateRef<any>;
  constructor() {}

  ngOnInit() {}
}

在模块引用的地方

import { NgModule } from '@angular/core';
import { NgxDatatableFooterModule } from 'ngx-datatable-footer';

@NgModule({
  declarations: [FooterPageStaticsComponent],
  imports: [
    NgxDatatableFooterModule.forRoot({{ pageStatics: FooterPageStaticsComponent }})
  ]
  ...
  entryComponents: [FooterPageStaticsComponent],
})
export class MyModule {}

需要把 FooterPageStaticsComponent 添加到 entryComponents 中

完全自定义

在使用的地方,如下示例,可以完全替换页脚

<ngx-datatable-footer [datatable]="datatable">
  <ng-template
    ngx-datatable-footer-template
    let-rowCount="rowCount"
    let-pageSize="pageSize"
    let-selectedCount="selectedCount"
    let-curPage="curPage"
    let-offset="offset"
  >
    <div style="padding: 5px 10px">
      <div>
        <strong>Summary</strong>
        : Gender: Female
      </div>
      <hr style="width: 100%" />
      <div>Rows: {{ rowCount }} | Size: {{ pageSize }} | Current: {{ curPage }} | Offset: {{ offset }}</div>
    </div>
  </ng-template>
</ngx-datatable-footer>

变量定义

| 变量 | 说明 | | ------------- | ----------------------------------------------------------------------------- | | rowCount | 总行数 | | pageSize | 每页数量 | | selectedCount | 已选择数量 | | curPage | 当前页数 | | offset | 页偏移量 | | config | 配置信息 labels={ current: '当前 ',line: '行',page: '页',jumpTo: '跳转到',} |