jayrock

load a tree : ExtJs - Jayrock

一曲冷凌霜 提交于 2019-12-25 04:43:23
问题 im trying to build a treepanel (or just a simple tree i just need it to work) and load it with data from database here is my code to build the tree var objHandler = new Interact(); var treestore = new Ext.data.TreeStore ( { root:{ id:'root_node', nodeType:'async', text:'Root' }, proxy:{ type:'ajax', url:'myUrl' } }); function ReadTree() { try { objHandler.ReadAssets(function (serverResponse) { if (serverResponse.error == null) { var result = serverResponse.result; if (result.length > 2) {

How to convert Json String to Object with Dictionary using JayRock

做~自己de王妃 提交于 2019-12-11 09:50:55
问题 I want to convert a Json string to an Object in C#. the string is like this: {"dealName":"name1","properties":{"a":"1", "b":"2"}} I define the class like this: public class DealInfo { public string dealName; public Dictionary<string, string> properties; } And I use this code to convert: DealInfo dl = JsonConvert.Import(typeof(DealInfo), jsonString) as DealInfo; I found it just converted the dealName field, but the properties count is 0. So, what's the problem? How to fix it? Many thanks! 回答1: