FineUI 选中多行获取行ID
http://www.fineui.com/bbs/forum.php?mod=viewthread&tid=2506&page=1
/// <summary>
/// 选中的行
/// </summary>
/// <param name="grid"></param>
/// <returns></returns>
protected string HowManyRowsAreSelected(Grid grid)
{
StringBuilder sb = new StringBuilder();
int selectedCount = grid.SelectedRowIndexArray.Length;
if (selectedCount > 0)
{
sb.AppendFormat("共选中了 {0} 行:", selectedCount);
sb.Append("<table class=\"result\">");
sb.Append("<tr><th>行号</th>");
foreach (string datakey in grid.DataKeyNames)
{
sb.AppendFormat("<th>{0}</th>", datakey);
}
sb.Append("</tr>");
for (int i = 0; i < selectedCount; i++)
{
int rowIndex = grid.SelectedRowIndexArray[i];
sb.Append("<tr>");
sb.AppendFormat("<td>{0}</td>", rowIndex + 1);
// 如果是内存分页,所有分页的数据都存在,rowIndex 就是在全部数据中的顺序,而不是当前页的顺序
if (grid.AllowPaging && !grid.IsDatabasePaging)
{
rowIndex = grid.PageIndex * grid.PageSize + rowIndex;
}
object[] dataKeys = grid.DataKeys[rowIndex];
for (int j = 0; j < dataKeys.Length; j++)
{
sb.AppendFormat("<td>{0}</td>", dataKeys[j]);
}
sb.Append("</tr>");
}
sb.Append("</table>");
}
else
{
sb.Append("<strong>没有选中任何一行!</strong>");
}
return sb.ToString();
}
FineUI 选中多行获取行ID的更多相关文章
- jquery datatable 多行(单行)选择(select),行获取/行删除
jquery datatable 多行(单行)选择(select),行获取/行删除 代码展示 // 示例数据源 var dataSet = [ ['Tasman','Internet Explorer ...
- 获取CPU ID ,disk ID, MAC ID (windows ARM linux Mac)
windows 命令行获取CPU ID,可以用ShellExecute wmic cpu get processorid ProcessorId BFEBFBFF000506E3 开源库: 查询CPU ...
- resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found.
resultset 对象获取行字段数据时报:java.sql.SQLException: Column 'id' not found. 代码: String sql="SELECT d.co ...
- Jqgrid获取行id
//获取选中行(单行)的ID var id = $("#table").jqGrid('getGridParam','selrow'); //根据id获取行数据,返回的是列表 va ...
- jqGrid根据ID获取行号
根据行号获取ID $('#grid').getCell(rownumber,'id') 根据ID获取行号 $('#' + rowid)[0].rowIndex
- WPF DataGrid 获取选中 一行 或者 多行
WPF中DataGrid使用时,需要将其SelectedItem转换成DataRowView进行操作 然而SelectedItem 与SelectedItems DataGrid的SelectionU ...
- TextView 获取行数,某一行的内容,某行的宽度
获取行数 ViewTreeObserver vto = textView.getViewTreeObserver(); vto.addOnGlobalLayoutListener(new OnGlob ...
- MFC LIST 获取行数和列数
DWORD dwStyle = dataListControl.GetExtendedStyle(); dwStyle |= LVS_EX_FULLROWSELECT;//选中某行使整行高亮(只适用与 ...
- LayUI之table数据表格获取行、行高亮等相关操作
前言 目前LayUI数据表格既美观有不乏一些实用功能.基本上表格应有的操作已经具备,LayUI作者[贤心]肯定是煞费苦心去优化,此处致敬.但是实话实话,如果单纯那数据表格功能来说,EasUI的数据表格 ...
随机推荐
- keras-anomaly-detection 代码分析——本质上就是SAE、LSTM时间序列预测
keras-anomaly-detection Anomaly detection implemented in Keras The source codes of the recurrent, co ...
- spring AOP自定义注解 实现日志管理
今天继续实现AOP,到这里我个人认为是最灵活,可扩展的方式了,就拿日志管理来说,用Spring AOP 自定义注解形式实现日志管理.废话不多说,直接开始!!! 关于配置我还是的再说一遍. 在appli ...
- javaweb web.xml版本
web.xml版本的xsd分为如下几个版本 web-app_2_2.xsd web-app_2_3.xsd web-app_2_4.xsd web-app_2_5.xsd .... web-app_3 ...
- linux thtree level page tables
To translate a virtual address into a physical one, the CPU must take the contents of each level fie ...
- learning uboot how to set ddr parameter in qca4531 cpu
DDR工作频率 在600MHZ. include/configs/board953x.h #define CFG_PLL_FREQ CFG_PLL_650_600_200 #d ...
- sgu101 欧拉路径 难度:1
101. Domino time limit per test: 0.25 sec. memory limit per test: 4096 KB Dominoes – game played wit ...
- CF 463A && 463B 贪心 && 463C 霍夫曼树 && 463D 树形dp && 463E 线段树
http://codeforces.com/contest/462 A:Appleman and Easy Task 要求是否全部的字符都挨着偶数个'o' #include <cstdio> ...
- noip2005循环
题解: 迭代,一次次k累加计算 代码: #include<bits/stdc++.h> using namespace std; ; ][N],ans[N]; char s[N]; boo ...
- VMware Station NAT上网模式配置
- 超炫jQuery测试答题功能
推荐一款超炫jQuery测试答题功能插件 实例代码 <body> <div class="container" id="main"> & ...