Skip to content

Commit

Permalink
added rowHeight options, which improve the performance
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlin1986 committed Feb 23, 2021
1 parent ca9145c commit b93383a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/js/cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,10 @@ Cell.prototype.checkHeight = function(){
};

Cell.prototype.clearHeight = function(){
this.element.style.height = "";
this.height = null;
if(this.table.options.rowHeight==null){
this.element.style.height = "";
this.height = null;
}
};


Expand All @@ -597,7 +599,7 @@ Cell.prototype.setHeight = function(){
};

Cell.prototype.getHeight = function(){
return this.height || this.element.offsetHeight;
return this.table.options.rowHeight || this.height || this.element.offsetHeight;
};

Cell.prototype.show = function(){
Expand Down
2 changes: 1 addition & 1 deletion src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var Tabulator = function(element, options){

//default setup options
Tabulator.prototype.defaultOptions = {

rowHeight:false, //fixed row height to improve performance, which does avoid the need of calculate cell height
height:false, //height of tabulator

layout:"fitData", ///layout type "fitColumns" | "fitData"
Expand Down

0 comments on commit b93383a

Please sign in to comment.