解決layui的table.checkStatus失效問題
更新時間:2022年10月25日 16:27:28 作者:stefanie_sun723
這篇文章主要介紹了解決layui的table.checkStatus失效問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
layui的table.checkStatus失效
解決方法
要將checkStatus的定義放在active中定義的函數(shù)里
//觸發(fā)事件+ var active = { //修改密碼函數(shù) modifyPwd: function() { var checkStatus = table.checkStatus('id'); // console.log(checkStatus.data) //獲取選中行的數(shù)據(jù) // console.log(checkStatus.data.length) //獲取選中行數(shù)量,可作為是否有選中行的條件 // console.log(checkStatus.isAll) //表格是否全選 if (checkStatus.data.length == 0) { layer.msg('請選擇一條記錄'); } else { } } }
layui table.checkStatus顯示undefine
將layui調(diào)用的主體函數(shù)中的此方法去除試試
?done: function (res, cuur, count) { ? ? ? ? ? ? ? ? layer.closeAll('loading'); ?? ??? ??? ??? ?table = res.result; ?? ??? ??? ??? ?}
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
一文搞懂JavaScript中bind,apply,call的實現(xiàn)
bind、call和apply都是Function原型鏈上面的方法,因此不管是使用function聲明的函數(shù),還是箭頭函數(shù)都可以直接調(diào)用。本文就帶你看看如何實現(xiàn)bind、call和apply2022-06-06寫了一個layout,拖動條連貫,內(nèi)容區(qū)可為iframe
寫了一個layout,拖動條連貫,內(nèi)容區(qū)可為iframe...2007-08-08