Hello,
Please see screenshot. I have a question. On query widget, is there any way to remove 'Statistics'? I am trying to set up query or filter widget on WAB. It is a bit confusing. My goal is to have all layers default invisibility until use filter or query widget apply results only to display. How can I procedure this? Please advise!! Thank you.
Solved! Go to Solution.
Alex,
To remove the Statistics... option from the widget action menu you have to alter some widget code. In the SingleQueryResult.js find the _onBtnMenuClicked function and make this change (line 24).
_onBtnMenuClicked: function(evt) {
var position = html.position(evt.target || evt.srcElement);
var featureSet = this._getFeatureSet();
var currentAttrs = this.getCurrentAttrs();
var layer = currentAttrs.query.resultLayer;
this.featureActionManager.getSupportedActions(featureSet, layer).then(lang.hitch(this, function(actions) {
array.forEach(actions, lang.hitch(this, function(action) {
action.data = featureSet;
}));
if (!currentAttrs.config.enableExport) {
var exportActionNames = [
'ExportToCSV',
'ExportToFeatureCollection',
'ExportToGeoJSON',
'SaveToMyContent'
];
actions = array.filter(actions, lang.hitch(this, function(action) {
return exportActionNames.indexOf(action.name) < 0;
}));
}
actions = array.filter(actions, lang.hitch(this, function(action) {
return action.name !== 'CreateLayer' && action.name !== 'ShowStatistics';
}));
....
Alex,
To remove the Statistics... option from the widget action menu you have to alter some widget code. In the SingleQueryResult.js find the _onBtnMenuClicked function and make this change (line 24).
_onBtnMenuClicked: function(evt) {
var position = html.position(evt.target || evt.srcElement);
var featureSet = this._getFeatureSet();
var currentAttrs = this.getCurrentAttrs();
var layer = currentAttrs.query.resultLayer;
this.featureActionManager.getSupportedActions(featureSet, layer).then(lang.hitch(this, function(actions) {
array.forEach(actions, lang.hitch(this, function(action) {
action.data = featureSet;
}));
if (!currentAttrs.config.enableExport) {
var exportActionNames = [
'ExportToCSV',
'ExportToFeatureCollection',
'ExportToGeoJSON',
'SaveToMyContent'
];
actions = array.filter(actions, lang.hitch(this, function(action) {
return exportActionNames.indexOf(action.name) < 0;
}));
}
actions = array.filter(actions, lang.hitch(this, function(action) {
return action.name !== 'CreateLayer' && action.name !== 'ShowStatistics';
}));
....
Hello Robert,
Thank you for your reply. I am using WAB from ArcGIS Online template. Is this only for WAB developer edition or ArcGIS Online Assistant? Please confirm.
Alex,
If you want to modify something that is not configurable like this in a widget them you will have to use WAB Dev.
Alex P. Be sure to mark Robert Scheitlin, GISP's answers as correct!