jQuery EasyUI 数据网格 - 取得选中行数据
来源:互联网 发布:美工小刀片 编辑:程序博客网 时间:2024/06/01 10:28
jQuery EasyUI 数据网格 - 取得选中行数据
本实例演示如何取得选中行数据。
数据网格(datagrid)组件包含两种方法来检索选中行数据:
- getSelected:取得第一个选中行数据,如果没有选中行,则返回 null,否则返回记录。
- getSelections:取得所有选中行数据,返回元素记录的数组数据。
创建数据网格(DataGrid)
<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>
使用演示
取得选中行数据:
var row = $('#tt').datagrid('getSelected');if (row){alert('Item ID:'+row.itemid+"\nPrice:"+row.listprice);}
取得所有选中行的 itemid:
var ids = [];var rows = $('#tt').datagrid('getSelections');for(var i=0; i<rows.length; i++){ids.push(rows[i].itemid);}alert(ids.join('\n'));
0 1
- jQuery EasyUI 数据网格 - 取得选中行数据
- jQuery EasyUI使用教程之从数据网格中获取选中行数据
- datagrid 取得选中行数据
- jQuery EasyUI 数据网格 - 创建子网格
- easyui取得选中行的数据
- easy-ui取得选中行数据项
- Jquery DataTables 获取表格数据及选中行数据
- Jquery DataTables 获取表格数据及选中行数据
- Easyui datagrid 获取选中行数据
- JQuery EasyUI 使用数据网格显示json数据(8)
- jquery ui选中表格多行数据
- EasyUI 数据网格
- EasyUI Datagrid 数据网格
- easyUI数据网格 简写
- EasyUI Datagrid 数据网格
- EasyUI DataGrid 数据网格
- jQuery EasyUI 应用 - 创建 CRUD 数据网格(DataGrid)
- jQuery EasyUI使用教程之添加工具栏到数据网格
- 将视频转换成MP4
- asascasc
- C#WPF VS2012 控件 事件窗口
- ReactiveCocoa - iOS开发的新框架
- 关于手机不能显示全部Logcat问题
- jQuery EasyUI 数据网格 - 取得选中行数据
- 深入理解ThreadLocal
- 利用JQuery的$.ajax()可以很方便的调用asp.net的后台方法。
- 解决eclipse打开出现Failed to create the java virtual machine
- 逻辑性
- C++数据结构课程设计报告(1号题)【物联网1132-11】
- How to handle exception in managed code and unmanaged code
- 安卓常见对比内容
- FragmentTabHost切换Fragment时避免重复加载UI