【Layui】Layui Table Tool Layer-tips
阿新 • • 發佈:2021-01-27
技術標籤:Javascriptlayuievent
類似這種效果,解決方法:
//快取當前操作的是哪個表格的哪個tr的哪個td $(document).off('mousedown','.layui-table-grid-down').on('mousedown','.layui-table-grid-down',function (event) { //直接記錄td的jquery物件 table._tableTrCurrr = $(this).closest('td'); }); //給彈出的詳情裡面的按鈕新增監聽級聯的觸發原始table的按鈕的點選事件 $(document).off('click','.layui-table-tips-main [lay-event]').on('click','.layui-table-tips-main [lay-event]',function (event) { var elem = $(this); var tableTrCurrr = table._tableTrCurrr; if(!tableTrCurrr){ return; } var layerIndex = elem.closest('.layui-table-tips').attr('times'); layer.close(layerIndex); table._tableTrCurrr.find('[lay-event="' + elem.attr('lay-event') + '"]').first().click(); });