0.0.3 • Published 4 years ago

ngx-virtual-scroll-tree v0.0.3

Weekly downloads
8
License
-
Repository
-
Last release
4 years ago

ngx-virtual-scroll-tree

Virtual Scroll Tree display a tree via a vitual scroll list. Compared with normal tree, virtual-scroll-tree is effective because the number of items displayed is fixed.

Usage

normal virtual scroll tree

  <ngx-virtual-scroll-tree class="file-tree" [treeData]="treeData">
  </ngx-virtual-scroll-tree>

make sure you set the width and height for the virtual scroll tree.

.file-tree {
    display: inline-block;
    width: 300px;
    height: 300px;
}

If you need to DIY the icon and the label by template

<div>
  <ngx-virtual-scroll-tree class="file-tree" [treeData]="treeData" [iconParentOpen]="iconParentOpen"
    [iconParentClose]="iconParentClose" [iconLeaf]="iconLeaf" [labelTemplate]="labelTemplate">
  </ngx-virtual-scroll-tree>

API

AttributeTypeDefaultDescription
treeDataany[]tree data need to display
lastTreeDataany[]Last tree data need to display. It is used for keeping the status of nodes of the tree
intendWidthnumber16the pixel of the indent width
iconParentOpenTemplateRefthe opened folder icon
iconParentCloseTemplateRefthe closed folder icon
iconLeafTemplateRefthe leaf icon
labelTemplateTemplateRefthe label template. You can decide what to show in the label
filterstringfilter the items whose label includes the filter
onclickLabelEventEmitterthe event is fired every time the label is clicked
ondblclickLabelEventEmitterthe event is fired every time the label is double clicked
ontoggleNodeEventEmitterthe event is fired every time the folder icon is clicked

Build

Run ng build ngx-virtual-scroll-tree to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build ngx-virtual-scroll-tree, go to the dist folder cd dist/ngx-virtual-scroll-tree and run npm publish.

Running unit tests

Run ng test ngx-virtual-scroll-tree to execute the unit tests via Karma.

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago