Ext.net获取选中行数据

两种方法

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>

 

posted @ 2018-12-30 11:55  zhaogaojian  阅读(769)  评论(0编辑  收藏  举报