解决layui表格操做列工具条目多个的时候,显示后点击没效果问题 - layui

一、如图中所示: 工具栏点击按钮无反应 
二、统一全局解决方法: 找到layui的table.js文件,打开文件找到初始化表格函数table.init,在此函数最后加上:
$(document).off('mousedown', '.layui-table-grid-down').on('mousedown', '.layui-table-grid-down', function(event){         
    table._tableTrCurr = $(this).closest('td');     
});     
$(document).off('click', '.layui-table-tips-main [lay-event]').on('click', '.layui-table-tips-main [lay-event]', function(event){         
    var elem = $(this);         
    var tableTrCurr = table._tableTrCurr;         
    if(!tableTrCurr){             
        return;         
    }         
    var layerIndex = elem.closest('.layui-table-tips').attr('times');                 
    //关闭当前这个显示更多的tip         
    layer.close(layerIndex);         
    tableTrCurr.find('[lay-event="' + elem.attr('lay-event') + '"]').first().click();     
});
相关文章
相关标签/搜索