Skip to content

Commit

Permalink
Give user more control on number of rows to be rendered at a time (#54)
Browse files Browse the repository at this point in the history
* Give more control to the user for rendering number of rows and number of blocks to be present at any time.

* Changed the comment to reflect the correctness
  • Loading branch information
asheshv authored Oct 15, 2021
1 parent 7bf037e commit 0b7cc53
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/infinite-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ class InfiniteTree extends events.EventEmitter {
selectable: true,
shouldSelectNode: null,

// Allow user to define the number of rows, and blocks to be rendered.
rowsInBlock: 50,
blocksInCluster: 4,

// When el is not specified, the tree will run in the stealth mode
el: null,

Expand Down Expand Up @@ -376,7 +380,9 @@ class InfiniteTree extends events.EventEmitter {
scrollElement: this.scrollElement,
contentElement: this.contentElement,
emptyText: this.options.noDataText,
emptyClass: this.options.noDataClass
emptyClass: this.options.noDataClass,
rowsInBlock: this.options.rowsInBlock,
blocksInCluster: this.options.blocksInCluster,
});

this.clusterize.on('clusterWillChange', () => {
Expand Down

0 comments on commit 0b7cc53

Please sign in to comment.