Browse Source

回滚 table 查找多级表头最后一列的判断

pull/1226/head
贤心 2 years ago
parent
commit
707fd941e9
  1. 15
      src/modules/table.js

15
src/modules/table.js

@ -814,20 +814,13 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
if(that.autoColNums > 0 && patchNums >= -colNums && patchNums <= colNums){
var getEndTh = function(th){
var field, thRet;
th = th || that.layHeader.eq(0).find('thead th:last-child')
layui.each(th, function (thIndex, thElem) {
thElem = $(thElem);
if (!thElem.children('.'+ELEM_GROUP).length) { // 排除合并表头
field = thElem.attr('data-field');
thRet = thElem;
}
})
var field;
th = th || that.layHeader.eq(0).find('thead > tr:first-child > th:last-child')
field = th.data('field');
if(!field && th.prev()[0]){
return getEndTh(th.prev())
}
return thRet
return th;
};
var th = getEndTh();
var key = th.data('key');

Loading…
Cancel
Save