String jsonStr = "{'id':'1','name':'name1','desc','description1'}";
json.put('value1',jsonStr); //String对象
json.put('value2',new JSONObject(jsonStr)); //Object对象
response.getWriter().print(json.toString());
var json=Ext.util.JSON.decode(response.responseText);
var value1 = json.value1;//{'id':'1','name':'name1','desc','description1'}
json.put('value1',jsonStr); //String对象
json.put('value2',new JSONObject(jsonStr)); //Object对象
response.getWriter().print(json.toString());
var json=Ext.util.JSON.decode(response.responseText);
var value1 = json.value1;//{'id':'1','name':'name1','desc','description1'}
var value2 = json.value2;//[object]
如果Json返回的是Object对象,则可以通过下面的方法直接转换为Record,如果是String对象则不能正确转换为Record:
Ext.data.Record( Array data, [Object id] );