分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
A:
参见
- http://examples.ext.net/#/GridPanel/Selection_Models/Submitting_Values/
- http://examples.ext.net/#/GridPanel/Selection_Models/Row_Selection/
要点,前台提取数据,后台解析JSON字符串。
前台:
后台:
protected void SubmitSelection(object sender, DirectEventArgs e) { string json = e.ExtraParams["Values"]; if (string.IsNullOrEmpty(json)) { return; } //XML will be represent as //<records> // <record><Name>Alcoa Inc</Name><Price>29.01</Price><Change>0.42</Change><PctChange>1.47</PctChange></record> // ... // <record>...</record> //</records> XmlNode xml = JSON.DeserializeXmlNode("{records:{record:" + json + "}}"); foreach (XmlNode row in xml.SelectNodes("records/record")) { string name = row.SelectSingleNode("Name").InnerXml; string price = row.SelectSingleNode("Price").InnerXml; string change = row.SelectSingleNode("Change").InnerXml; string pctChange = row.SelectSingleNode("PctChange").InnerXml; //handle values } List<Company> companies = JSON.Deserialize<List<Company>>(json); foreach (Company company in companies) { string name = company.Name; double price = company.Price; double change = company.Change; double pctChange = company.PctChange; //handle values } Dictionary<string, string>[] companies1 = JSON.Deserialize<Dictionary<string, string>[]>(json); foreach (Dictionary<string, string> row in companies1) { string name = row["Name"]; string price = row["Price"]; string change = row["Change"]; string pctChange = row["PctChange"]; //handle values } this.ResourceManager1.AddScript("Ext.Msg.alert('Submitted', 'Please see source code how to handle submitted data');"); }