Hello.
I'm doing an application based on a sample - ArcGIS API for JavaScript Sandbox
Only in my case initially loaded all the fields:
//build query filter
query = new esri.tasks.Query();
query.outSpatialReference = {"wkid": 102100};
query.returnGeometry = true;
query.outFields = ["*"];
//create the infoTemplate to be used in the infoWindow.
infoTemplate = new esri.InfoTemplate("${FIELD_NAME}", "${*}");
Next I need to be able to choose the displayed fields, how can I get a list of all the fields layer
Thanks in advance and sorry for my english