layui获取选中行数据
来源:互联网 发布:three.js入门指南 编辑:程序博客网 时间:2024/05/16 10:53
第一步: 在jsp文件中设置按钮
<div class="layui-btn-group demoTable">
<button class="layui-btn" data-type="getCheckData">获取选中行数据</button><button class="layui-btn" data-type="getCheckLength">获取选中数目</button>
<button class="layui-btn" data-type="isAll">验证是否全选</button>
</div>
第二步 在jsp文件中创建表格
<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}">职业</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,监听事件
<script>
layui.use('table', function(){
var table = layui.table;
var $ = layui.$, active = {
getCheckData: function(){ //获取选中数据
var checkStatus = table.checkStatus('idTest')
,data = checkStatus.data;
layer.alert(JSON.stringify(data));
}
};
</script>
- layui获取选中行数据
- dataTables获取选中行数据
- DataTables获取选中行数据
- gridcontrol获取选中行数据
- Qt 获取tableview的选中行数据
- wpf 获取 datatable 选中行数据
- Easyui datagrid 获取选中行数据
- jqGrid 使用示例&获取选中行数据
- bootstrap table 获取选中行数据
- 获取datagridview中checkbox选中的多行数据
- Android ListView中获取修改选中行数据的方法
- Jquery DataTables 获取表格数据及选中行数据
- Jquery DataTables 获取表格数据及选中行数据
- dataTables 获取表格数据及选中行数据
- C#中listview允许选中整行,并获取选中行数据
- 获取DataGridView中checkBox选中的多行数据并将选中的行插入数据库
- datagrid 取得选中行数据
- JqGrid选中行、取消选中行、获得选中行数据
- VS2015 C# System.Data.SQLite
- Android 之路12---Java基础7
- 【iOS】自定义CALayer可能会出现没有动画过程但有动画结果的解析
- CUDA
- 改变viewPager滑动的速度,利用反射完美实现
- layui获取选中行数据
- 递归算法及经典例子实现
- HTML select 复选框 互相值转换
- sftp配置
- 流式布局
- JAVA的数据类型
- 装载、链接与库总结
- 将输入的三个整数从小到大输出
- 下载远程URL文件