zoukankan      html  css  js  c++  java
  • EXT.NET循环取GridPanel数据

    前台代码:

    <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');");
    }

  • 相关阅读:
    mysql 查询缓存
    DevExpress 使用示例
    搜索营销推广学习资料
    mysql 导出表结构
    Google nexus one 获取root权限
    ASP.NET 使用Get方式请求WebService,并得到DataSet结果
    Iweboffice 2009 Winform版 Word文件的打开与保存
    【转】mysql 分析查找执行效率慢的SQL语句
    java.sql.BatchUpdateException: Lock wait timeout exceeded; try restarting transaction
    java 中job的core配置
  • 原文地址:https://www.cnblogs.com/leischen/p/2592957.html
Copyright © 2011-2022 走看看