How do you go about removing/disabling some options from some widgets (e.g. share widget) in dev ed of WAB (e.g.)
Solved! Go to Solution.
Q. From the layer list widget, the description option in the dropdown menu?
A. This is a setting in the LayerList widget settings dialog.
Q. From the add data widget, the vector tile option and kml from the type menu
A.
1. In the AddData\search\templates\TypeOptions.html make this change:
<label for="${id}_kmlId" class="search-type-option"
data-dojo-attach-point="kmlNode">
<input id="${id}_kmlId"
data-dojo-type="dijit/form/CheckBox"
data-dojo-attach-point="kmlToggle"
data-dojo-attach-event="onClick: optionClicked"
data-option-q='type:"KML"'/>
${i18n.search.typeOptions.kml}
</label>
2. In the AddData\search\TypeOptions.js postCreate method make this change:
postCreate: function() {
this.inherited(arguments);
if (!VectorTileLayer || !VectorTileLayer.supported()) {
console.warn("AddData: Vector Tile is not supported.");
this.vectorTileNode.style.display = "none";
}
this.own(on(this.tooltipDialog, "open", lang.hitch(this, function() {
var v = this.searchPane.wabWidget.appConfig.theme.name;
this.tooltipDialog.domNode.className += " " + v;
})));
this.vectorTileNode.style.display = "none";
this.kmlNode.style.display = "none";
},
Q. From the add data widget, under the URL tab, the options for kml, georss and csv
A. In the AddData\search\templates\AddFromUrlPane.html make this change:
<div class="secondary-pane add-url-pane">
<div class="add-url-pane-container">
<div class="add-url-pane-container--inner">
<label for="${id}_select">${i18n.addFromUrl.type}</label>
<select id="${id}_select"
data-dojo-type="dijit/form/Select" data-dojo-attach-point="typeSelect">
<option value="ArcGIS" selected="selected">${i18n.addFromUrl.types.ArcGIS}</option>
<option value="WMS">${i18n.addFromUrl.types.WMS}</option>
<!--not yet supported <option value="WMTS">${i18n.addFromUrl.types.WMTS}</option> -->
<!--not yet supported <option value="WFS">${i18n.addFromUrl.types.WFS}</option> -->
<!-- <option value="KML">${i18n.addFromUrl.types.KML}</option>
<option value="GeoRSS">${i18n.addFromUrl.types.GeoRSS}</option>
<option value="CSV">${i18n.addFromUrl.types.CSV}</option> -->
</select>
...
Gareth,
Some (which ones) or all?
Robert,
I'd like to customise most of them although don't want to be continually asking questions. Is the content mainly in one file for each widget?
Gareth,
Each widget will be different, depending on what option you want to remove. Most widget will require editing the Widget.js and/or Widget.html file though.
Robert,
I'd like to remove some options from the default share widget (e.g.)
Set display language of the app
Any assistance would be greatly appreciated.
Gareth
Robert,
How do you remove the following options:
From the layer list widget, the description option in the dropdown menu?
From the add data widget, the vector tile option and kml from the type menu?
From the add data widget, under the URL tab, the options for kml, georss and csv?
Thanks
Gareth
Q. From the layer list widget, the description option in the dropdown menu?
A. This is a setting in the LayerList widget settings dialog.
Q. From the add data widget, the vector tile option and kml from the type menu
A.
1. In the AddData\search\templates\TypeOptions.html make this change:
<label for="${id}_kmlId" class="search-type-option"
data-dojo-attach-point="kmlNode">
<input id="${id}_kmlId"
data-dojo-type="dijit/form/CheckBox"
data-dojo-attach-point="kmlToggle"
data-dojo-attach-event="onClick: optionClicked"
data-option-q='type:"KML"'/>
${i18n.search.typeOptions.kml}
</label>
2. In the AddData\search\TypeOptions.js postCreate method make this change:
postCreate: function() {
this.inherited(arguments);
if (!VectorTileLayer || !VectorTileLayer.supported()) {
console.warn("AddData: Vector Tile is not supported.");
this.vectorTileNode.style.display = "none";
}
this.own(on(this.tooltipDialog, "open", lang.hitch(this, function() {
var v = this.searchPane.wabWidget.appConfig.theme.name;
this.tooltipDialog.domNode.className += " " + v;
})));
this.vectorTileNode.style.display = "none";
this.kmlNode.style.display = "none";
},
Q. From the add data widget, under the URL tab, the options for kml, georss and csv
A. In the AddData\search\templates\AddFromUrlPane.html make this change:
<div class="secondary-pane add-url-pane">
<div class="add-url-pane-container">
<div class="add-url-pane-container--inner">
<label for="${id}_select">${i18n.addFromUrl.type}</label>
<select id="${id}_select"
data-dojo-type="dijit/form/Select" data-dojo-attach-point="typeSelect">
<option value="ArcGIS" selected="selected">${i18n.addFromUrl.types.ArcGIS}</option>
<option value="WMS">${i18n.addFromUrl.types.WMS}</option>
<!--not yet supported <option value="WMTS">${i18n.addFromUrl.types.WMTS}</option> -->
<!--not yet supported <option value="WFS">${i18n.addFromUrl.types.WFS}</option> -->
<!-- <option value="KML">${i18n.addFromUrl.types.KML}</option>
<option value="GeoRSS">${i18n.addFromUrl.types.GeoRSS}</option>
<option value="CSV">${i18n.addFromUrl.types.CSV}</option> -->
</select>
...
Thanks Robert. This was very helpful. Your assistance is much appreciated