Kendo Grid不接受

时间:2015-04-01 06:26:14

标签: json kendo-ui kendo-grid

我的Kendo Grid接受以下json格式

{"GetAllStratagyResult":[{"Id":14,"Region":"xxx","Terminal":"NGAY-HG6","Type":1,"VerisonNumber":"5476","VersionDate":"\/Date(1427782421023+0400)\/","VersionName":"Second Version1","content":"<p><span>Lorem ipsum dolor sit amet, consectetuer adipiscing elit<\/span><\/p><p><span>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.<\/span><\/p><p><span>Proin pharetra novnummy pede.<\/span><\/p><p>cccccccccc<\/p>"},{"Id":15,"Region":"yyy","Terminal":"NGAY-HG6","Type":1,"VerisonNumber":"456","VersionDate":"\/Date(1427722608457+0400)\/","VersionName":"Second Version1","content":"Lorem ipsum dolor sit amet, consectetuer adipiscing elit."},{"Id":16,"Region":"zzz","Terminal":"NGAY-HG6","Type":1,"VerisonNumber":"456","VersionDate":"\/Date(1427722395997+0400)\/","VersionName":"Second Version1","content":"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas."}]

但它不会显示以下json的列值:

{"readexcelbyteResult":"[{\"IFRS\":\"Volume\",\"2001\":\"645645\",\"2002\":\"875\",\"2003\":\"8598\",\"2004\":\"6986\",\"2005\":\"98698\",\"2006\":\"698698\",\"2007\":\"6989698\",\"2008\":\"57487\",\"2009\":\"487487\",\"2010\":\"4875\",\"2011\":\"458\"},{\"IFRS\":\"ipsum \",\"2001\":\"456456\",\"2002\":\"6986\",\"2003\":\"98698\",\"2004\":\"6986\",\"2005\":\"986\",\"2006\":\"98698\",\"2007\":\"698698\",\"2008\":\"6986\",\"2009\":\"98698\",\"2010\":\"69860606\",\"2011\":\"9860\"},{\"IFRS\":\"dolor \",\"2001\":\"366397\",\"2002\":\"4364\",\"2003\":\"98308\",\"2004\":\"467\",\"2005\":\"4086\",\"2006\":\"40874\",\"2007\":\"6487\",\"2008\":\"4984\",\"2009\":\"8749\",\"2010\":\"87598\",\"2011\":\"4874\"},{\"IFRS\":\"amet\",\"2001\":\"646456\",\"2002\":\"875\",\"2003\":\"8598\",\"2004\":\"6986\",\"2005\":\"98698\",\"2006\":\"698698\",\"2007\":\"6989698\",\"2008\":\"57487\",\"2009\":\"487487\",\"2010\":\"4875\",\"2011\":\"458\"},{\"IFRS\":\"consectetuer \",\"2001\":\"645645\",\"2002\":\"6986\",\"2003\":\"98698\",\"2004\":\"6986\",\"2005\":\"986\",\"2006\":\"98698\",\"2007\":\"698698\",\"2008\":\"6986\",\"2009\":\"98698\",\"2010\":\"69860606\",\"2011\":\"9860\"},{\"IFRS\":\"adipiscing \",\"2001\":\"536397\",\"2002\":\"4364\",\"2003\":\"98308\",\"2004\":\"467\",\"2005\":\"4086\",\"2006\":\"40874\",\"2007\":\"6487\",\"2008\":\"4984\",\"2009\":\"8749\",\"2010\":\"87598\",\"2011\":\"4874\"},{\"IFRS\":\"Maecenas \",\"2001\":\"456456\",\"2002\":\"875\",\"2003\":\"8598\",\"2004\":\"6986\",\"2005\":\"98698\",\"2006\":\"698698\",\"2007\":\"6989698\",\"2008\":\"57487\",\"2009\":\"487487\",\"2010\":\"4875\",\"2011\":\"458\"},{\"IFRS\":\"porttitor \",\"2001\":\"564564\",\"2002\":\"6986\",\"2003\":\"98698\",\"2004\":\"6986\",\"2005\":\"986\",\"2006\":\"98698\",\"2007\":\"698698\",\"2008\":\"6986\",\"2009\":\"98698\",\"2010\":\"69860606\",\"2011\":\"9860\"},{\"IFRS\":\"congue \",\"2001\":\"366397\",\"2002\":\"4364\",\"2003\":\"98308\",\"2004\":\"467\",\"2005\":\"4086\",\"2006\":\"40874\",\"2007\":\"6487\",\"2008\":\"4984\",\"2009\":\"8749\",\"2010\":\"87598\",\"2011\":\"4874\"}]"}

我所有的模式,json响应的模型和结构都是一样的。

请有人帮助我

1 个答案:

答案 0 :(得分:0)

在第二种情况下,您在元素{ "readexcelbyteResult":"[数组之前有引号,这使得系统将其理解为字符串而不是数据数组。此外,在引号\"IFRS\":\"Volume\"之前,所有元素似乎都有一个额外的转义字符:"IFRS":"Volume"

所以,看起来应该是这样的:

{"readexcelbyteResult":[{"IFRS":"Volume","2001":"645645","2002":"875","2003":"8598","2004":"6986","2005":"98698","2006":"698698","2007":"6989698","2008":"57487","2009":"487487","2010":"4875","2011":"458"},{"IFRS":"ipsum","2001":"456456","2002":"6986","2003":"98698","2004":"6986","2005":"986","2006":"98698","2007":"698698","2008":"6986","2009":"98698","2010":"69860606","2011":"9860"},{"IFRS":"dolor ","2001":"366397","2002":"4364","2003":"98308","2004":"467","2005":"4086","2006":"40874","2007":"6487","2008":"4984","2009":"8749","2010":"87598","2011":"4874"}, {"IFRS":"amet","2001":"646456","2002":"875","2003":"8598","2004":"6986","2005":"98698","2006":"698698","2007":"6989698","2008":"57487","2009":"487487","2010":"4875","2011":"458"},{"IFRS":"consectetuer ","2001":"645645","2002":"6986","2003":"98698","2004":"6986","2005":"986","2006":"98698","2007":"698698","2008":"6986","2009":"98698","2010":"69860606","2011":"9860"},{"IFRS":"adipiscing ","2001":"536397","2002":"4364","2003":"98308","2004":"467","2005":"4086","2006":"40874","2007":"6487","2008":"4984","2009":"8749","2010":"87598","2011":"4874"},{"IFRS":"Maecenas ","2001":"456456","2002":"875","2003":"8598","2004":"6986","2005":"98698","2006":"698698","2007":"6989698","2008":"57487","2009":"487487","2010":"4875","2011":"458"},{"IFRS":"porttitor ","2001":"564564","2002":"6986","2003":"98698","2004":"6986","2005":"986","2006":"98698","2007":"698698","2008":"6986","2009":"98698","2010":"69860606","2011":"9860"},{"IFRS":"congue ","2001":"366397","2002":"4364","2003":"98308","2004":"467","2005":"4086","2006":"40874","2007":"6487","2008":"4984","2009":"8749","2010":"87598","2011":"4874"}]}