easy-ui取得选中行数据项
来源:互联网 发布:下载卖装备软件 编辑:程序博客网 时间:2024/05/18 18:04
1.数据网格(datagrid)有两种方法来读取选中行数据:
1.getSelected:取得第一个选中行数据,如果没有选中行,则返回 null,否则返回记录。
2.getSelections:取得所有选中行数据,返回元素记录的数组数据。2.创建表格
<table id="tt" class="easyui-datagrid" style="width:600px;height:250px" url="data/datagrid_data.json" title="Load Data" iconCls="icon-save"> <thead> <tr> <th field="itemid" width="80">Item ID</th> <th field="productid" width="80">Product ID</th> <th field="listprice" width="80" align="right">List Price</th> <th field="unitcost" width="80" align="right">Unit Cost</th> <th field="attr1" width="150">Attribute</th> <th field="status" width="60" align="center">Stauts</th> </tr> </thead></table>
pic
3.1读取选中行某一列数据
var row = $('#tt').datagrid('getSelected');
if (row){
alert('Item ID:'+row.itemid);
}
3.2读取选中行所有列据
var ids = [];var rows = $('#tt').datagrid('getSelections'); for(var i=0; i<rows.length; i++){ ids.push(rows[i].itemid); }alert(ids.join(''));
pic
1 0
- easy-ui取得选中行数据项
- easy-ui datagrid弹框显示选中行数据
- datagrid 取得选中行数据
- Easy UI datagrid 多行数据操作
- jquery ui选中表格多行数据
- jQuery EasyUI 数据网格 - 取得选中行数据
- Easy UI Combotree选中项样式问题的hack
- 取得Flex4 DataGrid组件的当前选中行数据的方法
- BootStrap(二) -- 在表格行添加按钮并取得选中行数据
- easy ui datagrid checkbox 默认选中问题
- easy ui tree 默认选中指定行
- easy UI 获取datagrid选中多少行
- MSSQL 取得下周行数据
- dataTables获取选中行数据
- DataTables获取选中行数据
- layui获取选中行数据
- gridcontrol获取选中行数据
- JqGrid选中行、取消选中行、获得选中行数据
- a href=#与 a href=javascript:void(0) 的区别
- Android 资源匹配过程详解
- ActivePerl、dmake、nasm、nmake编译OpenSSL(1.1.0系列)
- 百度高德地图 坐标系转换
- 二叉树面试题--已知二叉树的两种遍历序列,求出另一种遍历序列
- easy-ui取得选中行数据项
- 基于珠海鼎芯科技imx6开发板 tslib1.4的移植
- C# 生成一个随机数
- 如何安装最新的 XFCE 桌面?
- 【NOIP2004】合唱队形
- Hibernate中JPA的简单使用,实现简单的对表的增删改查操作
- 编译openwrt全过程
- 源码-JavaScript&jQuery交互式前端开发-第6章-事件-变动事件
- PL/SQL developer10注册码