Question

I have a json response like this

{
   "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" } 
      ]
   }
}

I need to excecute using dojo data.ItemFileReadStore . I used

 var layout4 = [{

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

which is not working .Help please Thanks in Advance

Was it helpful?

Solution

Please try ;

var layout4 = {
items : [{

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

In the "identifier" field give the name of the field from your "items" which will always have a unique value.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top