1.0.1 • Published 5 years ago

axiom-ngx-tree v1.0.1

Weekly downloads
23
License
MIT
Repository
github
Last release
5 years ago

Axiom Tree

Online Demo

Usage Demo

Stackblitz Demo

Edit demo on stackblitz

Installation

Install component package from npm :

npm install axiom-ngx-tree

Import component module :
import { AxiomNgxTreeModule } from 'axiom-ngx-tree';

...

@NgModule({
  imports: [
    BrowserModule,
    AxiomNgxTreeModule,
  ], 
  declarations: [
    AppComponent
  ],
  bootstrap: [AppComponent]
})

...

Usage

<ax-ngx-tree [axData]="data" 
    (axSelect)="select($event)" 
    [axSearch]= "search"
    [axSearchValue]="model" 
    [axTitle]="'country'" 
    [axId]="'id'" 
    [axSelectable]="true"
    [axDragDrop]="true"
    [axCollectionItem]="'items'" 
    (axSelection)="selected($event)"
    [axTemplate]="t">
</ax-ngx-tree>
Use custom templates for nodes

First, Create a template tag then use item property to access node data

<ng-template #t let-item="item">
    {{ item.first_name }} {{ item.last_name }}
</ng-template>

Then pass custom template reference to [axTemplate] input parameter

[axTemplate]="t"

Drag and drop support

For add drag and drop feature just set [axDragDrop] property value to true

Alt Text

@Input() Params

NameUsage
axIdData uniqueidentifier property name
axTitleDefault node title (Used in nodes without custom template )
axCollectionItemName list propery (like items in an object)
axSearchValueSearch model value for providing instant search
axSelectableMake tree selectable
axSearchSearch function with type (item: any, search: string): boolean
axTemplateMake custom node template
axDragDropAdd drag and drop feature
axAsyncSet tree to work async
axLeafData propery name to check a node is leaf in data tree or not (Just use in async mode)
axAsyncReaderReader function to get async data for inner nodes
axDataTree data

@Output() Params

NameUsage
axSelectionEmit an array containing selected nodes
axSelectEmit a object refers to current node

License

MIT

1.0.1

5 years ago

1.0.0

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago