Permalink
Browse files

fix: 优化不显示滚动条情况下动态改变宽度导致最后一列显示宽度超长的问题

  • Loading branch information...
liuyk
liuyk committed Dec 8, 2016
1 parent 361d04c commit 3c3a452560e38dfd0d57aac890c46480b524f4a5
Showing with 13 additions and 0 deletions.
  1. +13 −0 js/gridCompWDChange.js
View
@@ -97,19 +97,32 @@ const noScrollWidthReset = function(){
}else{
//先按100%来处理
var hasP = false;
var nowWholeWidth = 0;
for(var i = 0; i < this.gridCompColumnArr.length; i++){
var column = this.gridCompColumnArr[i];
var nowWidth = column.options.width + '';
if(nowWidth.indexOf('%') > 0){
var newWidth = parseInt(nowWidth.replace('%', '') * this.wholeWidth / 100);
hasP = true;
}else{
var newWidth = nowWidth;
if(column.options.visible){
nowWholeWidth += parseInt(nowWidth);
}
}
if(newWidth < this.minColumnWidth){
newWidth = this.minColumnWidth;
}
this.setColumnWidth(column,newWidth);
}
if(!hasP && nowWholeWidth > this.wholeWidth){
var nowW = this.lastVisibleColumn.options.width;
var w = nowW - (nowWholeWidth - this.wholeWidth);
this.lastVisibleColumn.options.width = w;
}
}
this.hasNoScrollRest = true;

0 comments on commit 3c3a452

Please sign in to comment.