Socket
Book a DemoInstallSign in
Socket

nt-table

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nt-table

Agile table component for Angular

1.0.0-rc.21
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

NT Table

What does it do?

It is a ready table component made for agile development use which offers: ✔ Serverside (sorting,filtering,pagination) ✔ Row Drag & Pin ✔ Row edit, delete ✔ Column Drag & Pin ✔ Mulit row select ✔ Hide/Show Columns ✔ Export to CSV ✔ Print ✔ Responsive Design ✔ Custom actions template(soon)

Example

But how it works?

NT Table uses ag-grid and angular materials on the backgound. It uses agile standard JSON structure for crud operations. You can look DEMO.

Try it

See it in action DEMO

How to use it?

Since library uses angular material on the backgound 1 Install angular materials: npm install --save @angular/material @angular/cdk @angular/animations 2 Import material theme required for table: Paste this styles to global style.scss 3 Install nt-table to to your project

npm i nt-table --save Import the NtTableModule and BrowserAnimationsModule to your app.module.ts:

import {NtTableModule} from 'nt-table';
@NgModule({
  imports: [
    BrowserAnimationsModule, // required for angular material
    NtTableModule
  ],
})
export class AppModule {}

Use the nt-table component

Note: You must provide height and height on parent div so table will inherit it otherwise table will not be seen.

<div style="width: 1100px;height: 650px">
 <ngx-nt-table
 [apiUrl]="http://nodejs-test-api.us-east-2.elasticbeanstalk.com/api/table"
 ></ngx-nt-table>
</div>

Do not like Actions template?

No worries, soon going to enable feature to insert customs actions template.

API

Inputs

 /** Whether or not table should be multi selectable **/
  @Input() apiUrl: string= 'your api url';

  /** Whether to have Print feature **/
  @Input() printable :boolean = true;

  /** Whether to have Column hide/show feature **/
  @Input() columnHideAble :boolean = true;

  /** Whether to exort feature **/
  @Input() exportable :boolean = true;

  /** Whether or not table show have edit functionality **/
  @Input() editable :boolean = true;

 /** Whether or not row pinnable **/
 @Input() rowPinnable :boolean = true;

  /** Whether or not table should be multi selectable **/
  @Input() multiSelect :boolean= true;

Output events

 /** Emitted when clicked on 'Add data' **/
   @Output()  private onRowAdd = new EventEmitter();`
  /** Emitted after row edit success **/
   @Output()  private onRowEdited = new EventEmitter();`
 /** Emitted after row edit success **/
   @Output()  private onRowRemoved = new EventEmitter();`

Methods

Since it is not efficient to enable 'add' funcionality on library, plugin emits (rowAdd) event on 'Add data' click. After you implement 'add' functionality you call manually trigger table to load data from server again.
To do that you give table a reference
 <ngx-nt-table
 #table
 [apiUrl]="http://nodejs-test-api.us-east-2.elasticbeanstalk.com/api/table"
 ></ngx-nt-table>

on Typescript:

@ViewChild('table') table: NtTableComponent;

and tell table to update data:

this.table.updateData()

Compatibility

Angular 6.0+ Angular-materials 6.0+

Want to Contribute ?

Please fork project from github. Pull requests are kindly accepted.

FAQs

Package last updated on 07 Dec 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.