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){
|
if(that.autoColNums > 0 && patchNums >= -colNums && patchNums <= colNums){
|
||||||
var getEndTh = function(th){
|
var getEndTh = function(th){
|
||||||
var field, thRet;
|
var field;
|
||||||
th = th || that.layHeader.eq(0).find('thead th:last-child')
|
th = th || that.layHeader.eq(0).find('thead > tr:first-child > th:last-child')
|
||||||
layui.each(th, function (thIndex, thElem) {
|
field = th.data('field');
|
||||||
thElem = $(thElem);
|
|
||||||
if (!thElem.children('.'+ELEM_GROUP).length) { // 排除合并表头
|
|
||||||
field = thElem.attr('data-field');
|
|
||||||
thRet = thElem;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if(!field && th.prev()[0]){
|
if(!field && th.prev()[0]){
|
||||||
return getEndTh(th.prev())
|
return getEndTh(th.prev())
|
||||||
}
|
}
|
||||||
return thRet
|
return th;
|
||||||
};
|
};
|
||||||
var th = getEndTh();
|
var th = getEndTh();
|
||||||
var key = th.data('key');
|
var key = th.data('key');
|
||||||
|
|
Loading…
Reference in New Issue