Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng-treetable

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-treetable

Tree table component for angular 2+.

  • 1.3.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Angular 2 Style Guide MIT license

Tree Table component for Angular

A tree table component for Angular, based on Primeng treetable.

Getting Started

npm install --save ng-treetable

Demo

Live Demo

Configuration

Angular cli

After installation, no additional configuration is needed. Import the TreeTableModule and define it as one of the imports of your application module:

import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {TreeTableModule} from "ng-treetable";

import {AppComponent} from './app.component';

@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule,
        TreeTableModule
    ],
    bootstrap: [
        AppComponent
    ]
})
export class AppModule {}

Data type

{
    "data":
    [  
        {  
            "data":{  
                "name":"Andrew",
                "gender":"Male"
            },
            "children":[
                {  
                    "data":{  
                        "name":"Andrewson",
                        "gender":"Male"
                    },
                    "children":[  
                        {  
                            "data":{  
                                "name":"Eric",
                                "gender":"Male"
                            }
                        }                       
                    ]
                }
            ]
        }
    ]
}

Examples

Basic

<ay-treeTable [value]="data">
    <ay-column field="name" header="Name"></ay-column>
    <ay-column field="gender" header="Gender"></ay-column>
</ay-treeTable>

Paginator

<ay-treeTable [value]="data" [rows]="10" [paginator]="true" [pageLinks]="3" [rowsPerPageOptions]="[5,10,20]">
    <ay-column field="name" header="Name"></ay-column>
    <ay-column field="gender" header="Gender"></ay-column>
</ay-treeTable>

Filter

<input #gb type="text" pInputText size="50" placeholder="Global Filter">
<ay-treeTable [value]="data" [globalFilter]="gb" [rows]="10" [paginator]="true" [pageLinks]="3" [rowsPerPageOptions]="[5,10,20]">
    <ay-column field="name" header="Name"></ay-column>
    <ay-column field="gender" header="Gender"></ay-column>
</ay-treeTable>

Input properties

NameTypeDefaultDescription
valuearraynullAn array of treenodes.
rowsnumbernullNumber of rows to display per page.
paginatorbooleanfalseWhen specified as true, enables the pagination.
totalRecordsnumbernullNumber of total records, defaults to length of value when not defined.
pageLinksnumber5Number of page links to display in paginator.
rowsPerPageOptionsarraynullArray of integer values to display inside rows per page dropdown of paginator
immutablebooleanfalseImproves performance by avoiding diff checking, changes to value should be done in an immutable way on application side when immutable property is enabled.
globalFilteranynullReference of an input field to use as a global filter.
filterDelaynumber300Delay in milliseconds before filtering the data.
labelExpandstringExpandTooltip and screenreader text for expand icon.
labelCollapsestringCollapseTooltip and screenreader text for collapse icon.
selectionModestringnullDefines the selection mode, valid values "single" and "multiple".
selectionanynullA single treenode instance or an array to refer to the selections.
stylestringnullInline style of the component.
styleClassstringnullStyle class of the component.
metaKeySelectionbooleantrueDefines how multiple items can be selected, when true metaKey needs to be pressed to select or unselect an item and when set to false selection of each item can be toggled individually. On touch enabled devices, metaKeySelection is turned off automatically.

Events

NameParametersDescription
onNodeSelectevent.originalEvent: browser event event.node: Selected node instance.Callback to invoke when a node is selected.
onNodeUnselectevent.originalEvent: browser event event.node: Unselected node instance.Callback to invoke when a node is unselected.
onNodeExpandevent.originalEvent: browser event event.node: Expanded node instance.Callback to invoke when a node is expanded.
onNodeCollapseevent.originalEvent: browser event event.node: Collapsed node instance.Callback to invoke when a node is collapsed.
onContextMenuSelectevent.originalEvent: browser event event.node: Selected node instance.Callback to invoke when a node is selected with right click.

Keywords

FAQs

Package last updated on 03 Feb 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc