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?

1 Answer 1


This was the solution, http://www.sencha.com/forum/showthread.php?245126-Dynamically-assigning-titles-to-Ext.grid-columns

I needed to create the columns fields separately and then add the attrfields to the ArrayReader.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.