欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

 更新時間:2019年09月13日 14:04:57   作者:繾綣つ  
今天小編就為大家分享一篇layui-table表復(fù)選框勾選的所有行數(shù)據(jù)獲取的例子,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

項目需求,可以用復(fù)選框勾選項目進(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'}">測試項</th>
    <th lay-data="{field:'t2', edit: 'text'}">標(biāo)定參數(shù)</th>
    <th lay-data="{field:'t3'}">標(biāo)定值</th>
  </tr>
  </thead>
</table>

我們已經(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-table表復(fù)選框勾選的所有行數(shù)據(jù)獲取的例子就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論