EXT.NET循环取GridPanel数据
2012-07-16 08:38
232 查看
前台代码:
<ext:Button ID="SubmitSelection" runat="server" Text="遍历数据" Icon="PageWhiteEdit"
ToolTip="遍历数据">
<DirectEvents>
<Click OnEvent="SubmitSelection_Click">
<ExtraParams>
<ext:Parameter Name="Values" Value="Ext.encode(#{GridPanelMain}.getRowsValues({selectedOnly : true}))"
Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
后台代码
[DirectMethod]
protected void SubmitSelection_Click(object sender, Ext.Net.DirectEventArgs e)
{
string json = e.ExtraParams["Values"];
if (string.IsNullOrEmpty(json))
{
return;
}
//<records><record><DictCode>JQFL</DictCode>
//<DictName>警情分类</DictName>
//<DictValue>
// </DictValue>
//<IsSystem>true
// </IsSystem><IsShow>true</IsShow><IsUse>true</IsUse><DisplayOrder>37</DisplayOrder><Creator>开发人员
// </Creator><CreateTime>2012-03-05T13:59:06</CreateTime><Editor /></record>
//</records>
XmlNode xml = JSON.DeserializeXmlNode("{records:{record:" + json + "}}");
foreach (XmlNode row in xml.SelectNodes("records/record"))
{
string DictCode = row.SelectSingleNode("DictCode").InnerXml;
string DictName = row.SelectSingleNode("DictName").InnerXml;
string DictValue = row.SelectSingleNode("DictValue").InnerXml;
string CreateTime = row.SelectSingleNode("CreateTime").InnerXml;
}
List<sys_Dict> Dicts = JSON.Deserialize<List<sys_Dict>>(json);
foreach (sys_Dict Dict in Dicts)
{
string name = Dict.DictName;
}
Dictionary<string, string>[] Dicts1 = JSON.Deserialize<Dictionary<string, string>[]>(json);
foreach (Dictionary<string, string> row in Dicts1)
{
string name = row["DictName"];
}
this.ResourceManagerMain.AddScript("Ext.Msg.alert('Submitted', 'Please see source code how to handle submitted data');");
}
<ext:Button ID="SubmitSelection" runat="server" Text="遍历数据" Icon="PageWhiteEdit"
ToolTip="遍历数据">
<DirectEvents>
<Click OnEvent="SubmitSelection_Click">
<ExtraParams>
<ext:Parameter Name="Values" Value="Ext.encode(#{GridPanelMain}.getRowsValues({selectedOnly : true}))"
Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
后台代码
[DirectMethod]
protected void SubmitSelection_Click(object sender, Ext.Net.DirectEventArgs e)
{
string json = e.ExtraParams["Values"];
if (string.IsNullOrEmpty(json))
{
return;
}
//<records><record><DictCode>JQFL</DictCode>
//<DictName>警情分类</DictName>
//<DictValue>
// </DictValue>
//<IsSystem>true
// </IsSystem><IsShow>true</IsShow><IsUse>true</IsUse><DisplayOrder>37</DisplayOrder><Creator>开发人员
// </Creator><CreateTime>2012-03-05T13:59:06</CreateTime><Editor /></record>
//</records>
XmlNode xml = JSON.DeserializeXmlNode("{records:{record:" + json + "}}");
foreach (XmlNode row in xml.SelectNodes("records/record"))
{
string DictCode = row.SelectSingleNode("DictCode").InnerXml;
string DictName = row.SelectSingleNode("DictName").InnerXml;
string DictValue = row.SelectSingleNode("DictValue").InnerXml;
string CreateTime = row.SelectSingleNode("CreateTime").InnerXml;
}
List<sys_Dict> Dicts = JSON.Deserialize<List<sys_Dict>>(json);
foreach (sys_Dict Dict in Dicts)
{
string name = Dict.DictName;
}
Dictionary<string, string>[] Dicts1 = JSON.Deserialize<Dictionary<string, string>[]>(json);
foreach (Dictionary<string, string> row in Dicts1)
{
string name = row["DictName"];
}
this.ResourceManagerMain.AddScript("Ext.Msg.alert('Submitted', 'Please see source code how to handle submitted data');");
}
相关文章推荐
- Ext.Net 1.x_Ext.Net.GridPanel如何后台遍历GridPanel中的数据?
- Ext.Net 1.x_Ext.Net.GridPanel如何后台遍历GridPanel中的数据?
- Ext.net中Gridpanel更新数据时,滚动条位置保持不变
- Ext.Net 复制GridPanel的数据
- Ext.Net点击GridPanel中一行,在FormPanel里后台加载详细数据
- asp.net 不用控件 循环输出数据库数据的方法
- asp.net网站中的Gridview循环判断数据是否被选中
- [Ext.NET]之动态绑定GridPanel
- Ext.Net 学习 之 GridPanel、 Store 取值
- Ext.Net 1.x_Ext.Net.GridPanel关键字添加背景色
- EXT.NET GridPanel 靠右显示,字体颜色,千分位
- Ext.NET之动态绑定GridPanel
- Ext修改GridPanel数据和字体颜色、css属性等
- asp.net网站中的Gridview循环判断数据是否被选中
- Ext.Net 1.x_Ext.Net.GridPanel 之锁定列
- Ext.Net 1.2.0_Ext.Net.GridPanel 实现多级Grid
- Ext.Net 1.x_Ext.Net.GridPanel关键字添加背景色
- ext.net 动态创建GridPanel中Store与ColumnModel
- Ext.Net 1.x_Ext.Net.GridPanel 之锁定列
- EXT.NET循环并且选中TreePanel的某些值