1、前台页面
在button中添加ExtraParams
 
<DirectEvents>
<Click>
<ExtraParams>
<ext:Prameter Name="Values" Value="Ext.encode({#GridPanelName}.getRowsValues({selectedOnly:true}))" Mode="Raw">
</ExtraParams>
</Click>
</DirectEvents>
Tips:(1)Ext.encode()  将对象转换成Json字符串;Ext.decode() 将Json字符串转换成对象
2、后台代码
string json=e.ExtraParams["Values"];     //得到json格式的数据
Dictionary<string, string>[] detail = JSON.Deserialize<Dictionary<string, string>[]>(json); //反序列化json成字典
foreach(Dictionary<string, string> row in sqlDetail )
{
string id=row["ID"];..... 获取数据
}

Tips:JSON序列化与反序列化

(1)字典 Dictionary

//序列化
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add("Name", "张三");
dic.Add("Age", "");
dic.Add("Gender", "女");
string json = JSON.Serialize(dic); //反序列化
string json= @"[{"Name":"张三","Age":18,"Gender":"女"}]";
Dictionary<string, string> dic = JSON.Deserialize<Dictionary<string, string>>(json);

(2)集合 List

//序列化
List<Person> list = new List<Person>();
list.Add(new Person{Name="张三",Age=,Gerder="女"});
list.Add(new Person{Name="李四",Age=,Gender="男"});
string json = JSON.Serialize(list); //反序列化
string json=@"[{"Name":"张三","Age":18,"Gender":"女"},{"Name":"李四","Age":21,"Gender":"男"}]";
List<Person> list= JSON.Deserialize<List<Person>>(json);
 

Ext.net GridPanel获取选中行的数据的更多相关文章

  1. bootstrapTable:获取选中行的数据

    必须要有checkbox:true和singleSelect:true,然后就可以通过var row=$("#mytab").bootstrapTable('getSelectio ...

  2. easy ui datagrid 获取选中行的数据

    取得选中行数据: var row = $('#tt').datagrid('getSelected'); if (row){ alert('Item ID:'+row.itemid+" Pr ...

  3. DEV GridControl 获取选中行的数据

    private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowCha ...

  4. ExtJS中获取选中行的数据

    listeners: { select:function(rowModel,record){ var data = rowModel.getLastSelected(); console.log(&q ...

  5. jQuery DataTables 获取选中行数据

    如题 想获取操作 DataTables 获取选中行数据 案1.主要是利用 js  getElementsByTagName 函数 然后对获取到的tr 进行操作  如下 function getChec ...

  6. gridview获取选中行索引及当前行数据

    gridview获取选中行索引及当前行数据 一.非直接绑定数据: <!--前台传值--> <asp:TemplateField HeaderText="操作"&g ...

  7. jqgrid 获取选中行主键集合

    如何获取选中行的主键集合呢? 使用  getGridParam(selarrrow) 方法可获取所有选中行的主键集合. 注意:此处的主键集合是指-设置为主键的列(key: true).再次提醒:一个j ...

  8. EasyUi DataGrid 获取选中行的checkbox

    EasyUi DataGrid 获取选中行的checkbox var checked = $(":checkbox[name=ID]:checked"); console.log( ...

  9. datagrid如何获取选中行的索引

    //datagrid获取选中行 var row =baseSelectgrid.datagrid('getSelected'); // 获取被选中行的索引 index var index=baseSe ...

随机推荐

  1. NSString字符串类型-学习总结

    1.字符串的创建 (1)创建常量字符串 NSString *str = @"This is a String"; //str是变量名 (2)创建空的字符串,给字符串赋值 NSStr ...

  2. OpenGL ES 2.0 混合

    混合技术 混合技术就是将俩个片元调和,主要用于将通过各项测试准备进入帧缓冲的片元(源片元)与原有片元按照设定的比例加权计算出最终片元的颜色值. OpenGL ES 2.0中是通过设置混合因子来指定两个 ...

  3. poj2378 树形DP

    C - 树形dp Crawling in process... Crawling failed Time Limit:1000MS     Memory Limit:65536KB     64bit ...

  4. C/C++中的成员函数指针声明及使用

    代码: #include <iostream> using namespace std; class Test{ public: void func(){ cout<<&quo ...

  5. nignx开启expires后相关资源不显示的问题

    expires可以指定浏览器缓存,加快浏览速度 但是开启expires必须先指定root server中原来指定 location / { root D:/WWW; index index.html ...

  6. python Cmd实例之网络爬虫应用

    python Cmd实例之网络爬虫应用 标签(空格分隔): python Cmd 爬虫 废话少说,直接上代码 # encoding=utf-8 import os import multiproces ...

  7. 字符串:格式化 - 零基础入门学习Python015

    字符串:格式化 让编程改变世界 Change the world by program 字符串:格式化 上节课我们介绍了Python字符串的N多种奇葩方法的用法,但我们唯独漏了一个format()方法 ...

  8. HTML5 例子学习 HT 图形组件

    HTML5 例子学习 HT 图形组件 HT 是啥:Everything you need to create cutting-edge 2D and 3D visualization. 这口号是当年心 ...

  9. [POJ] 3461 Oulipo [KMP算法]

    Oulipo Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 23667   Accepted: 9492 Descripti ...

  10. [Codeforces Round #186 (Div. 2)] B. Ilya and Queries

    B. Ilya and Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard ...