Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
DOJO json布局结构不工作_Json_Dojo_Dojox.grid - Fatal编程技术网

DOJO json布局结构不工作

DOJO json布局结构不工作,json,dojo,dojox.grid,Json,Dojo,Dojox.grid,我有一个类似这样的json响应 { "listResponse": { "page":0, "rows":10, "total":9, "items": [ { "abbr": "ec", "name": "Ecuador", "capital": "Quito" }, { "abbr": "eg", "name": "Egypt", "capital": "Cairo" }, {

我有一个类似这样的json响应

{
   "listResponse":
   {
      "page":0,
      "rows":10,
      "total":9,

      "items": [
         { "abbr": "ec", "name": "Ecuador", "capital": "Quito" },
         { "abbr": "eg", "name": "Egypt", "capital": "Cairo" },
         { "abbr": "sv", "name": "El Salvador", "capital": "San Salvador" },
         { "abbr": "gq", "name": "Equatorial Guinea", "capital": "Malabo" },
         { "abbr": "er", "name": "Eritrea", "capital": "Asmara" },
         { "abbr": "ee", "name": "Estonia", "capital": "Tallinn" },
         { "abbr": "et", "name": "Ethiopia", "capital": "Addis Ababa" } 
      ]
   }
}
我需要使用dojo data.ItemFileReadStore进行测试。我曾经

 var layout4 = [{

            field: 'abbr',
            name: 'Abbr',
            width: '200px'
        },
        {
            field: 'name',
            name: 'First Name',
            width: '200px'
        },
        {
            field: 'capital',
            name: 'Capital',
            width: '200px'
        }
这不起作用。请帮助,提前感谢

请尝试

var layout4 = {
items : [{

        field: 'abbr',
        name: 'Abbr',
        width: '200px'
    },
    {
        field: 'name',
        name: 'First Name',
        width: '200px'
    },
    {
        field: 'capital',
        name: 'Capital',
        width: '200px'
    }],
identifier :"field"
};

在“标识符”字段中,给出“项目”字段的名称,该字段将始终具有唯一值。

您实际尝试了什么?使用
ItemFileReadStore
的代码在哪里?“不工作”是什么意思?您一直在遵循哪些文档?您使用的是哪个版本的dojo?我尝试使用dojo和json响应创建网格。您需要发布足够的信息,以便其他人能够重现您的问题。你没那么做!就像我问你:你能帮我去图书馆吗?