Robert,
I'd like to customize the Esearch little bit. I'd like to get a report for the result of the search( may be a new window of HTML page to list the result attribute info). I created a 'report' button next to the 'clear' button on the result tab. if user click on the 'report' button a new window will open to show all the attribute info. I could get the result data from
this.currentFeatures.attributes.ADDRESS;
this.currentFeatures.attributes.Parcel_ID;
I have to list all the field names individually, I have a long list of the field name. Is there a easy way get the field name and attribute info all together within a for loop?
Thanks
Solved! Go to Solution.
Zhujing,
Sure you have that data already (the att object) you just need to make this adjustment:
var featureAttributes = this.currentFeatures.attributes; for (var att in featureAttributes) { console.info(att + ": " + this.currentFeatures.attributes[att]); }
Zhujing,
Sure just do something like this:
var featureAttributes = this.currentFeatures.attributes; for (var att in featureAttributes) { console.info(this.currentFeatures.attributes[att]); }
Robert,
Yes. That will return all the attribute values. But is there a way to get the Field Name as well? I'd like to show the field name and the value of the attribute together.
For instance, Address: 18 New Hempstead RD
Parcel ID : 12345
Owner: John Smith
...........
Zhujing,
Sure you have that data already (the att object) you just need to make this adjustment:
var featureAttributes = this.currentFeatures.attributes; for (var att in featureAttributes) { console.info(att + ": " + this.currentFeatures.attributes[att]); }
Great. Thanks Robert
Zhujing,
Your welcome don't forget to mark this thread as answered.
Robert,
Could you let me know where you set up the ZoomAll and the Clear button in the Result tab to let them not display when there is no result. I'd like to do the same thing for my Report button.
Thanks
Zhujing,
Sure it is here:
_clearLayers: function () {
this._removeAllResultLayers();
html.setStyle(this.btnZoomAll, 'display', 'none');
html.setStyle(this.btnClear, 'display', 'none');
html.setStyle(this.btnClear2, 'display', 'none');
html.setStyle(this.btnClear3, 'display', 'none');
html.setStyle(this.btnExport, 'display', 'none');
},
Worked.
Robert,
I have another question. Is there a way to know which layer this.currentFeaturs got from? I'd like to put different title in my report dependences on the data layer..
Thanks