溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

layui-table表復(fù)選框勾選所有行數(shù)據(jù)獲取的示例分析

發(fā)布時(shí)間:2021-05-22 10:52:49 來源:億速云 閱讀:709 作者:小新 欄目:web開發(fā)

這篇文章主要介紹layui-table表復(fù)選框勾選所有行數(shù)據(jù)獲取的示例分析,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!

項(xiàng)目需求,可以用復(fù)選框勾選項(xiàng)目進(jìn)行提交,如下表

<table class="layui-table" lay-data="{url:'******', id:'test3'}" lay-filter="test3">

  <thead>
  <tr>
    <th lay-data="{type:'checkbox'}">ID</th>
    <th lay-data="{field:'id', width:80}">ID</th>
    <th lay-data="{field:'t1'}">測試項(xiàng)</th>
    <th lay-data="{field:'t2', edit: 'text'}">標(biāo)定參數(shù)</th>
    <th lay-data="{field:'t3'}">標(biāo)定值</th>
  </tr>
  </thead>
</table>

layui-table表復(fù)選框勾選所有行數(shù)據(jù)獲取的示例分析

layui-table表復(fù)選框勾選所有行數(shù)據(jù)獲取的示例分析

我們已經(jīng)獲取到了表中所有行的數(shù)據(jù),全選,部分選都可行,不用選復(fù)選框遍歷的方式去獲取數(shù)據(jù)

table.on('checkbox(test3)', function(obj){
      var checkStatus = table.checkStatus('test3');
      console.log(checkStatus.data)//選中行數(shù)據(jù)
      console.log(checkStatus.data.length)
      
      })
      
$('.ttes').click(function () {
      var index = parent.layer.getFrameIndex(window.name);
      var checkStatus = table.checkStatus('test3');
      console.log(checkStatus.data)//選中行數(shù)據(jù)
      var items = checkStatus.data;

layui是什么

layui是一款采用自身模塊規(guī)范編寫的前端UI框架,它遵循原生HTML/CSS/JS的書寫與組織形式,門檻極低,適合新手,并且它還提供了豐富的內(nèi)置模塊,他們皆可通過模塊化的方式按需加載,從核心代碼到API的每一處細(xì)節(jié)都經(jīng)過精心雕琢,非常適合界面的快速開發(fā),能夠作為PC網(wǎng)頁端后臺(tái)系統(tǒng)與前臺(tái)界面的速成開發(fā)方案。

以上是“l(fā)ayui-table表復(fù)選框勾選所有行數(shù)據(jù)獲取的示例分析”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI