I am trying to create a functionality that creates array data for any layer that user selects. Now I am able to get all the data in the feature layer that the user selects but I am having some trouble with the ArrayReader
to which I need to assign the field names of the feature data.
So this is field collection loop,
for (var prop in e.features[0].attributes) { attrfields.push(prop); }
As of now I am hard coding the ArrayReader
like this,
var myReader = new Ext.data.ArrayReader({},[
{name: 'family'},
{name: 'species'}
]);
I need to replace,
[{name: 'family'}, {name: 'species'}]
with the attrfields
, which looks like this,
[Object {"Family"}, Object {"Species"}]
Now am confused as to how I should create attrfields
to replace it in the ArrayReader
? Any suggesstions?