mirror of https://github.com/layui/layui
回滚 table 查找多级表头最后一列的判断
parent
7024375ab4
commit
707fd941e9
|
@ -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…
Reference in New Issue