I am trying to add a new line of custom text right before the Measurement Results Label in WAB developer edition and have not yet been able to figure out. I would greatly appreciate any help.
Solved! Go to Solution.
Anish,
Sure, in the Widget.js make these additions (lines 12 - 14, 27 - 29 and 43-45):
define([
'dojo/_base/declare',
'dojo/_base/lang',
'dojo/aspect',
'dojo/Deferred',
'dijit/_WidgetsInTemplateMixin',
'jimu/BaseWidget',
'jimu/portalUtils',
'jimu/dijit/Message',
'esri/units',
'esri/dijit/Measurement',
"esri/symbols/jsonUtils",
'dojo/query',
'dojo/dom-construct'
],
function(
declare,
lang,
aspect,
Deferred,
_WidgetsInTemplateMixin,
BaseWidget,
PortalUtils,
Message,
esriUnits,
Measurement,
jsonUtils,
query,
domContruct) {
.....
_hideToolsByConfig: function() {
if (false === this.config.showArea) {
this.measurement.hideTool("area");
}
if (false === this.config.showDistance) {
this.measurement.hideTool("distance");
}
if (false === this.config.showLocation) {
this.measurement.hideTool("location");
}
var node = query(".esriMeasurementResultLabel", this.measurement.domNode)[0];
var note = domContruct.toDom("<span>Blah blah</span>");
domContruct.place(note, node, "before");
},
Anish,
Sure, in the Widget.js make these additions (lines 12 - 14, 27 - 29 and 43-45):
define([
'dojo/_base/declare',
'dojo/_base/lang',
'dojo/aspect',
'dojo/Deferred',
'dijit/_WidgetsInTemplateMixin',
'jimu/BaseWidget',
'jimu/portalUtils',
'jimu/dijit/Message',
'esri/units',
'esri/dijit/Measurement',
"esri/symbols/jsonUtils",
'dojo/query',
'dojo/dom-construct'
],
function(
declare,
lang,
aspect,
Deferred,
_WidgetsInTemplateMixin,
BaseWidget,
PortalUtils,
Message,
esriUnits,
Measurement,
jsonUtils,
query,
domContruct) {
.....
_hideToolsByConfig: function() {
if (false === this.config.showArea) {
this.measurement.hideTool("area");
}
if (false === this.config.showDistance) {
this.measurement.hideTool("distance");
}
if (false === this.config.showLocation) {
this.measurement.hideTool("location");
}
var node = query(".esriMeasurementResultLabel", this.measurement.domNode)[0];
var note = domContruct.toDom("<span>Blah blah</span>");
domContruct.place(note, node, "before");
},
Robert, this worked great. You have been super helpful as always.
Great, don't forget to mark this as answered then.