两种方法
1、直接返回对象列表
<DirectEvents> <Click> <ExtraParams> <ext:Prameter Name="Values" Value="Ext.encode({#GridPanelName}.getRowsValues({selectedOnly:true}))" Mode="Raw"> </ExtraParams> </Click> </DirectEvents>
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"];..... 获取数据 }
第一种方法:http://www.cnblogs.com/RANCY/p/4905008.html
2、返回ID列表
<script type="text/javascript"> function GetIDS() { var json = mcp_gridlist.selectedIds; var ids = ""; for (var key in json) { ids += key + ","; } ids = ids.substr(0, ids.length - 1); document.getElementById("mcp_PKID").value = ids; } </script>
原文地址:https://www.cnblogs.com/zhaogaojian/p/10198950.html
时间: 2024-10-08 07:21:55