最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

layui獲取選中行數(shù)據(jù)的實例講解

 更新時間:2018年08月19日 13:43:57   作者:BooleanIsTrue  
今天小編就為大家分享一篇layui獲取選中行數(shù)據(jù)的實例講解,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

第一步: 在jsp文件中設(shè)置按鈕

<div class="layui-btn-group demoTable">

 <button class="layui-btn" data-type="getCheckData">獲取選中行數(shù)據(jù)</button>
 <button class="layui-btn" data-type="getCheckLength">獲取選中數(shù)目</button>
 <button class="layui-btn" data-type="isAll">驗證是否全選</button>
</div>

第二步:在jsp文件中創(chuàng)建表格

<table class="layui-table" lay-data="{width: 892, height:332, url:'/demo/table/user/', page:true, id:'idTest'}" lay-filter="demo">
 <thead>
  <tr>
   <th lay-data="{type:'checkbox', fixed: 'left'}"></th>
   <th lay-data="{field:'id', width:80, sort: true, fixed: true}">ID</th>
   <th lay-data="{field:'username', width:80}">用戶名</th>
   <th lay-data="{field:'sex', width:80, sort: true}">性別</th>
   <th lay-data="{field:'city', width:80}">城市</th>
   <th lay-data="{field:'sign', width:160}">簽名</th>
   <th lay-data="{field:'experience', width:80, sort: true}">積分</th>
   
   <th lay-data="{field:'classify', width:80}">職業(yè)</th>
   <th lay-data="{field:'wealth', width:135, sort: true}">財富</th>
   <th lay-data="{field:'score', width:80, sort: true, fixed: 'right'}">評分</th>
   <th lay-data="{fixed: 'right', width:178, align:'center', toolbar: '#barDemo'}"></th>
  </tr>
 </thead>
</table>

第三步:寫js,監(jiān)聽事件

<script>
layui.use('table', function(){
 var table = layui.table;
 
 var $ = layui.$, active = {
  getCheckData: function(){ //獲取選中數(shù)據(jù)
   var checkStatus = table.checkStatus('idTest')
   ,data = checkStatus.data;
   layer.alert(JSON.stringify(data));
  }
 };
</script>

以上這篇layui獲取選中行數(shù)據(jù)的實例講解就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論

宕昌县| 新绛县| 墨玉县| 叶城县| 莱州市| 凤庆县| 潢川县| 高台县| 雷波县| 大同县| 邹城市| 五家渠市| 辽宁省| 汝州市| 格尔木市| 张家口市| 周口市| 剑河县| 山阴县| 高尔夫| 正蓝旗| 集安市| 兰西县| 娄烦县| 浪卡子县| 惠水县| 绥宁县| 招远市| 鄄城县| 文成县| 永年县| 陇川县| 利川市| 巫山县| 甘南县| 长岭县| 阿图什市| 绥江县| 合阳县| 寿阳县| 勐海县|