diff --git a/src/modules/table.js b/src/modules/table.js index 6facaaae..39268a07 100644 --- a/src/modules/table.js +++ b/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');