mirror of https://github.com/layui/layui
修复table有固定列的复杂表头,筛选列之后出现的固定列高度跟本体不一致的问题;table字段配置新增fieldTitle属性用于筛选列和导出的时候自定义表头信息。
parent
df4c66a69b
commit
af0b38385c
|
@ -438,18 +438,6 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
||||||
// 让表格平铺
|
// 让表格平铺
|
||||||
that.fullSize();
|
that.fullSize();
|
||||||
|
|
||||||
// 如果多级表头,则填补表头高度
|
|
||||||
if(options.cols.length > 1){
|
|
||||||
// 补全高度
|
|
||||||
var th = that.layFixed.find(ELEM_HEADER).find('th');
|
|
||||||
// 固定列表头同步跟本体 th 一致高度
|
|
||||||
var headerMain = that.layHeader.first();
|
|
||||||
layui.each(th, function (thIndex, thElem) {
|
|
||||||
thElem = $(thElem);
|
|
||||||
thElem.height(headerMain.find('th[data-key="' + thElem.attr('data-key') + '"]').height() + 'px');
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
that.pullData(that.page); //请求数据
|
that.pullData(that.page); //请求数据
|
||||||
that.events(); //事件
|
that.events(); //事件
|
||||||
};
|
};
|
||||||
|
@ -1593,6 +1581,18 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
||||||
} else {
|
} else {
|
||||||
that.layMain.outerHeight(bodyHeight);
|
that.layMain.outerHeight(bodyHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果多级表头,则填补表头高度
|
||||||
|
if(options.cols.length > 1){
|
||||||
|
// 补全高度
|
||||||
|
var th = that.layFixed.find(ELEM_HEADER).find('th');
|
||||||
|
// 固定列表头同步跟本体 th 一致高度
|
||||||
|
var headerMain = that.layHeader.first();
|
||||||
|
layui.each(th, function (thIndex, thElem) {
|
||||||
|
thElem = $(thElem);
|
||||||
|
thElem.height(headerMain.find('th[data-key="' + thElem.attr('data-key') + '"]').height() + 'px');
|
||||||
|
})
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//获取滚动条宽度
|
//获取滚动条宽度
|
||||||
|
@ -1702,7 +1702,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
||||||
var lis = [];
|
var lis = [];
|
||||||
that.eachCols(function(i, item){
|
that.eachCols(function(i, item){
|
||||||
if(item.field && item.type == 'normal'){
|
if(item.field && item.type == 'normal'){
|
||||||
lis.push('<li><input type="checkbox" name="'+ item.field +'" data-key="'+ item.key +'" data-parentkey="'+ (item.parentKey||'') +'" lay-skin="primary" '+ (item.hide ? '' : 'checked') +' title="'+ util.escape($('<div>' + (item.title || item.field) + '</div>').text()) +'" lay-filter="LAY_TABLE_TOOL_COLS"></li>');
|
lis.push('<li><input type="checkbox" name="'+ item.field +'" data-key="'+ item.key +'" data-parentkey="'+ (item.parentKey||'') +'" lay-skin="primary" '+ (item.hide ? '' : 'checked') +' title="'+ util.escape($('<div>' + (item.fieldTitle || item.title || item.field) + '</div>').text()) +'" lay-filter="LAY_TABLE_TOOL_COLS"></li>');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return lis.join('');
|
return lis.join('');
|
||||||
|
@ -2503,7 +2503,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
||||||
|
|
||||||
if(content === undefined || content === null) content = '';
|
if(content === undefined || content === null) content = '';
|
||||||
|
|
||||||
i1 == 0 && dataTitle.push(item3.title || '');
|
i1 == 0 && dataTitle.push(item3.fieldTitle || item3.title || item3.field || '');
|
||||||
vals.push('"'+ parseTempData.call(thatTable, {
|
vals.push('"'+ parseTempData.call(thatTable, {
|
||||||
item3: item3
|
item3: item3
|
||||||
,content: content
|
,content: content
|
||||||
|
|
Loading…
Reference in New Issue