I am using identify onclick. I am able to get the attributes only with their specific names like
idResult.feature.attributes['FACIL_ID']
I want to retrieve all the fields and values from the attribute table of the layer.
Thanks
Qazi Iqbal
for a demo. use the following code:
var fields =[];
var fieldName;
for (attribute in idResult.feature.attributes)
{
fields.push(attribute);
}
for(var i=0; i<fields.length; i++)
{
fieldName =fields;
// field name
alert(fieldName);
// field value
alert(idResult.feature.attributes[fieldName]);
}