Skip to content

Commit

Permalink
优化表格树显示
Browse files Browse the repository at this point in the history
  • Loading branch information
yangzongzhuan committed Jun 29, 2021
1 parent b016f3a commit f765dbc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,23 @@
registerRowClickEvent();
initHiddenColumns();
// 动态设置表头宽度
autoTheadWidth()
autoTheadWidth();
// 移动端适配
var treetableTable = $(target).parent('.treetable-table');
var availableHeight = treetableTable.outerWidth();
if($.common.isMobile() || availableHeight < 769){
var tableStyle = "width: " + availableHeight + "px;overflow: auto;position: relative;";
treetableTable.attr('style', tableStyle);
var w = 0;
$.each(options.columns, function(i, column) {
if (i == 0 && column.field == 'selectItem') {
w += 36;
} else {
w += 200;
}
});
$(target).attr('style','width:' + w +'px');
}
}
// 动态设置表头宽度
var autoTheadWidth = function(initFlag) {
Expand Down Expand Up @@ -725,7 +741,7 @@
expandAll: false, // 是否全部展开
expandFirst: true, // 是否默认第一级展开--expandAll为false时生效
striped: false, // 是否各行渐变色
bordered: true, // 是否显示边框
bordered: false, // 是否显示边框
hover: true, // 是否鼠标悬停
condensed: false, // 是否紧缩表格
columns: [], // 列
Expand Down
Loading

0 comments on commit f765dbc

Please sign in to comment.