码迷,mamicode.com
首页 > Web开发 > 详细

Ext.Net GridPanel RowSelect 行选择事件

时间:2016-07-06 18:23:00      阅读:234      评论:0      收藏:0      [点我收藏+]

标签:

GridPanel中选中行,后台获取行json信息,再进行相关处理

<ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store1" StripeRows="true"
Title="Purchase Order" AutoExpandColumn="Company" Collapsible="true" EnableColumnMove="true"
Height="380" Header="false" Region="Center">
      <ColumnModel ID="ColumnModel1" runat="server">
            <Columns>
            <ext:Column ColumnID="Company" Header="Purchase Order" Align="Center" Width="200"
            DataIndex="Name" />
            </Columns>
      </ColumnModel>
      <SelectionModel>
            <ext:RowSelectionModel>
                  <DirectEvents>
                        <RowSelect OnEvent="Cell_Click">
                              <ExtraParams>
                                    <ext:Parameter Name="Values" Value="Ext.encode(#{GridPanel1}.getRowsValues({selectedOnly:true}))"
                                    Mode="Raw" />
                              </ExtraParams>
                        </RowSelect>
                  </DirectEvents>
            </ext:RowSelectionModel>
      </SelectionModel>
</ext:GridPanel>

后台CS:

protected void Cell_Click(object sender, DirectEventArgs e)
{
string json = e.ExtraParams["Values"];
Dictionary<string, string>[] companies = JSON.Deserialize<Dictionary<string, string>[]>(json);
foreach (Dictionary<string, string> row in companies)
{
foreach (KeyValuePair<string, string> keyValuePair in row)
{
string s=keyValuePair.Value;//Value值
}
}
}

Ext.Net GridPanel RowSelect 行选择事件

标签:

原文地址:http://www.cnblogs.com/guopm/p/5647454.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!