Enhanced Search Widget Version 2.21.1 - 11/16/21

07-14-2014 03:57 PM
Labels (1)

Enhanced Search Widget Version 2.21.1 - 11/16/21

Live Preview Site

Web AppBuilder for ArcGIS | Help - Enhanced Search widget


List of the latest enhancements and changes:

  1. Added Max rows of 10 to all the widgets dropdowns.


Older enhancements or changes

Check the "Older enhancements or changes.txt" in the download for a complete list.


Older Versions

Last 2.17 version

Last 2.13 version

Last 2.12 version

Last 2.11 version

Last 2.9 version

Last 2.7 version

Last 2.6 version

Last 2.5 version

Labels (1)

This is a tiny thing I noticed but I don't even know where to begin with what changed. Widget 2.4 on the Left has a X to clear the search field and 2.6 doesn't have that any longer?


hmm... I went back to my 2.4 version and I don't see that "x".


I think it only works in IE investigating it more.

Is there a way to set the graphical search to always stay active when the widget is active? I know there is the setting to keep graphical search enabled, but as soon as the onClose function is called and the widget is reopened the graphical search is no longer enabled.


  Sure just make this change to the onOpen function (lines 10- 12):

      onOpen: function () {
        if (!this.config.bufferDefaults.addtolegend) {
          if (this.graphicsLayerBuffer) {
        if (this.tempResultLayer) {

Thanks Robert!

Is there a way not zoom to the extent of the results if more than 1 feature is found?


  These customization of the eSearch widget questions really belong in new threads.

Oh ok I'll create a new one.

Hi Robert et al: I am finding that thus far, the build is working without error in 2.7 for my tabbed theme.  I did change the manifest.json when I brought the widget into the stemapp to read

"wabVersion": "2.7",

otherwise my graphical and query searches are behaving as expected.  I am not using any spatial searches. No issues with results formatting our output, the builder gui or anything. 

Hi Robert, 

I hope everything is going very well with you! Is it possible to add data from my web map in eSearch Widget? I can find only the rest URL. Since most of widgets work with the direct web map and I want to cooperate with the same data.


  you can work with the same data that is in your web map I just don’t provide a user interface to choose a layer from the map. You have to know the url that the web map uses for that layer.

Thanks Robert! How to add data in eSearch widget from layer.id == 'MyData_1234' ?

Hi Irfran - 

It depends on how you have added your layers to your webmap.  If your layers are hosted in your ArcGIS Online org, then the url will look something like this:


if you have added a SECURE layer to your org from your ArcServer and then added the layer to the webmap, then your url will something look like this:


if you have added a layer directly into your webmap from your ArcServer your url will look something like this:


you can look at Robert's widget help here:

Web AppBuilder for ArcGIS | Help - Enhanced Search widget 

Hi David,

Thanks for your reply! I have a secure layer coming from ArcServer and then added the layer in webmap. I am looking a way where I can give my data to eSearch Widget from webmap layer.It is because some of widgets they don't take direct url such as infographic , Situation Awareness, and InfoSummary Widget. For them data must be coming from webmap. I will really like any idea or suggestions.



  those other widgets need the layer to come from the web map and the eSearch is not map layer dependent. One of the benefits of the eSearch is that there is no need for the layer that is to be searched to exist in the map. I have no plans to add the convince capability of choosing a layer from the web map to be used in the widget, when it is just as easy to know your data and the url that was used to add the service to the web map originally.

Hi Robert , 

please how can i show the result of filter widget in map (selection) and how can i open the result automatically in attribute table .


   Please do not post a question multiple times in different places.

Here is your other thread where I have answered this question.



On the can the hyperlink be moved to the top of the results table instead of the bottom and if so how?

Do your widgets version numbers only work with the versions of WAB?

For example the Enhanced Search Widget Version is only for WAB 2.6?

The Identify Widget Version is only for WAB 2.5?

If I do not produce a new widget (i.e. Identify widget is still version 2.5.01) that means that I have had no changes to the code and it will work in the latest versions of WAB.

If Do not have any changes and there is no breaking changes in the latest WAB there is no need for me to just increment the version number of the widget.

As far as moving the the links to the top of the widget. That is a customization of the widget that you will need to start a new thread on. This thread is getting way to big for me to continue to give customization advice on.

ok, thanks.


Have you ever seen an issue when doing a search on the eSearch it doesn't list all the features.  For example it finds 5 features that match, it says Features selected: 5 but only lists out 4 features, and all 5 features are highlighted on the map.  I have this happening randomly on my Parcel layer.  I am using WAB 2.4 and version 2.4 or the eSearch widget.  Below is a link to our live site.  If you do a Parcel ID search on 6670 it comes back with 2 results, highlights both on the map in blue but only lists 1 out.  Same thing if you search my Parcel/owner name by Smitty it comes back with 20 results but only lists 14 features.  We did tweak the widget a little to be able to add our Deed link based on spatial reference.  I was hoping you could advise in which direction I should take in troubleshooting.

Land Use GIS Website 


   Your added code at this line is whats causing the issue.

var paramCount = this.deedURL.match(/&/gi).length; // this.deedURL.count(pattern);‍

The this.deedURL.match(/&/gi) is null so length is not a property of null.

I was playing around with this widget and was thinking that it could be useful for a Web App that I am building. Right now I am struggling with the "out of the box" Esri widgets because I am trying to view photos from a related table. Is this something that your widget can handle? Viewing images from a related table? 



   How are the photos stored in the related table? Are they attachments or url links in a field?


I believe they are stored as attachments. Have you had any experience with feature layers created via the Survey123 connect application? I used Survey123 connect to publish the feature, and in doing so, used the Repeat functionality, to create the related tables that house the attachments. Unfortunately following this approach has prevented me from being able to view the photos like I normally would have been able to do if the attachments were housed within the feature layer, and not the related tables. 

Hopefully what I wrote makes sense.



  I am not very familiar with Survey 123. But the The info provided is enough for me to give you the bad news. My widget will not be able to aide you with viewing the images.


That's ok. Thanks for getting back to me.

After showing results of a search is there a way to highlight the geometry when hovering over in the attribute table?  


   In the 2.7 version of the widget I will be adding a selection highlight when you click on a record in the widgets results, but not a highlight when you hover using the Attribute Table Widget.

I was trying too upgrad the eSearch widget from 2.6 to 2.7 in a applicaiton that is built. I copied\replaced the new 2.7 eSearch widget folder to the \server\apps\12\widgets folder. I opened up the app 12 made some changes to the WAB configuration eSearch widget and saved but the eSearch widget is still showing to be 2.6 (ctrl+alt +click on the widget). what i am doing wrong?

Hmm... Not sure whats going wrong. Your workflow sounds right. Can you check the manifest.json in the zip that you think is 2.7 and verify you have the right zip file?

After looking at the manifest.json i didn't replace it, It still said 2.6. Not sure what happen but i could have sworn i replaced. 

Anyways copy replaced the folder and it looks like the app is at 2.7 now. Thanks and sorry for the post.

Hi Robert , 

can you help me please  to add print widget to my code . 

<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
<title> Population Totale </title>
<link rel="stylesheet" href="http://js.arcgis.com/3.16/dijit/themes/tundra/tundra.css">

<link rel="stylesheet" href="http://js.arcgis.com/3.16/esri/css/esri.css">


#HomeButton { position: absolute; top: 90px; left: 20px; z-index: 2; }

body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
#map {
margin: 0;
padding: 0;
#feedback {
position: absolute;
height: 390px;
font-family: arial;
margin: 5px;
padding: 10px;
z-index: 40;
background: #fff;
color: #444;
width: 300px;
right: 10px;
top: 10px;
box-shadow: 0 0 5px #888;

#legendWrapper {
padding: 10px 0 0 0;
#note {
font-size: 80%;
font-weight: 700;
padding: 0 0 10px 0;
h3 {
margin: 0 0 5px 0;
border-bottom: 1px solid #444;


<script src="http://js.arcgis.com/3.16/"></script>

//global vars
var layer, legend;


"esri/dijit/HomeButton" ,





], function (
HomeButton ,



) {


var mapOptions = {
basemap: "topo",
center: [11,34],

zoom: 6,
slider: true ,


var map = new Map("map", mapOptions);

var basemapGallery = new BasemapGallery({
showArcGISBasemaps: true,
map: map
}, "basemapGallery");

basemapGallery.on("error", function(msg) {
console.log("basemap gallery error: ", msg);

// map.enableKeyboardNavigation();

var home = new HomeButton(
map: map
}, "HomeButton");

var fieldName = "PopTot2004";

// the counties map service uses the actual field name as the field alias
// set up an object to use as a lookup table to work with user friendly field names

var fields = {
"PopTot2004": "Population Totale (2004)",
"PopTot2005": "Population Totale (2005)",
"PopTot2006": "Population Totale (2006)",
"PopTot2007": "Population Totale (2007)",
"PopTot2008": "Population Totale (2008)" ,
"PopTot2009": "Population Totale (2009)" ,
"PopTot2010": "Population Totale (2010)" ,
"PopTot2011": "Population Totale (2011)" ,
"PopTot2012": "Population Totale (2012)" ,
"PopTot2013": "Population Totale (2013)" ,
"PopTot2014": "Population Totale (2014)",
"NOM" : "NOM"

var outFields = ["PopTot2004", "PopTot2005", "PopTot2006", "PopTot2007","PopTot2008","PopTot2009","PopTot2010","PopTot2011","PopTot2012","PopTot2013","PopTot2014","NOM"];

//create popup
var popupTemplate = new PopupTemplate({
title: "{NOM}",
fieldInfos: [

"fieldName": fieldName,
"label": fields[fieldName],
"visible": true,
"format": {
places: 0,
digitSeparator: true
showAttachments: true

layer = new FeatureLayer("", {
"id": "Chad",
"infoTemplate": popupTemplate,
"mode": FeatureLayer.MODE_SNAPSHOT,
"outFields": outFields,
"opacity": 0.8


//only working with Washington state

layer.on("load", function () {

function createRenderer(field) {
//smart mapping functionality begins
layer: layer,
field: field,
basemap: map.getBasemap(),
classificationMethod: "quantile" ,
//ClassBreakInfo(null, minValue:100000, maxValue:250000),


}).then(function (response) {
createLegend(map, layer, field);

//this function gets called when fields are selected to render
function updateAttribute(ch) {

var popupTemplateUpdated = new PopupTemplate({
title: "{NOM}",
fieldInfos: [{
"fieldName": ch,
"label": fields[ch],
"visible": true,
"format": { places: 0, digitSeparator: true }
showAttachments: true
createLegend(map, layer, ch);

//Create a legend
function createLegend(map, layer, field) {
//If applicable, destroy previous legend
if (legend) {

// create a new div for the legend
var legendDiv = domConstruct.create("div", {
id: "legendDiv"
}, dom.byId("legendWrapper"));

legend = new Legend({
map: map,
layerInfos: [{
layer: layer,
title: "Indicateur: " ,

}, legendDiv);

// create a store and a filtering select for the county layer's fields
var fieldNames, fieldStore, fieldSelect;
fieldNames = {
"identifier": "value",
"label": "name",
"items": []
array.forEach(outFields, function (f) {
if (array.indexOf(f.split("_"), "NOM") == -1) { // exclude attrs that contain "NAME"
"name": fields,
"value": f

fieldStore = new ItemFileReadStore({
data: fieldNames
fieldSelect = new FilteringSelect({
displayedValue: fieldNames.items[0].name,
value: fieldNames.items[0].value,
name: "fieldsFS",
required: false,
store: fieldStore,
searchAttr: "name",
style: {
"width": "290px",
"fontSize": "12pt",
"color": "#444"
}, domConstruct.create("div", null, dom.byId("fieldWrapper")));
fieldSelect.on("change", updateAttribute);



<body class="tundra">

<div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline',gutters:false" style="width: 100%; height: 100%; margin: 0;">
<div id="map" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">

<div id="feedback">
<h3>Population Totale(milliers habitants) </h3>
<div id="info">
Sélectionnez une année pour une visualisation cartographiqe .
<div id="legendWrapper"></div>
<div id="fieldWrapper">
Veuillez choisir l'année

<div id="HomeButton"></div>

<div style="position:absolute; left:20px; top:150px; z-Index:999;">
<div data-dojo-type="dijit/TitlePane"
data-dojo-props="title:'Fond de carte', closable:false, open:false">
<div data-dojo-type="dijit/layout/ContentPane" style="width:380px; height:280px; overflow:auto;">
<div id="basemapGallery"></div>




  You need to start a new thread as this tread is for questions about my eSearch widget.


I found an issue with the enhanced Search Widget even in this 2.7 version. The date field shows in the Enhanced search widget is different than the Identify widget. The result in Identified widget is correct but not in Enhanced Search Widget.

For instance, the date in my case  should be 09/24/1971, but it shows as 09/23/1971. Do you know where should I change the code?




  Do you date fields contain a time or just a date? Comparing the Identify with the eSearch is like apples and oranges as the identify uses a completely different task and means of getting the data from the server.

It is only the date no time.


When I used ESRI's search widget I got the result back for the date as '9/23/71, 8:00 PM'. Why it shows the time? I have no idea.


It looks like I have to Convert Time Zone to UTC.

I personally would just run a field calculator on the date fields to add a time portion like 1PM to all your dates.


I am experiencing an issue where version 2.7 of the eSearch widget's settings hang after adding it.

The console log shows the following:

stemapp/jimu.js/ServiceDefinitionManager.js?wab_dv=2.4 net::ERR_ABORTED

Error: scriptError   (init.js:36)
  at f (init.js:10)
  at HTMLScriptElement.<anonymous> (init.js:35)

This is happening with the eLocate as well but I had no issue with adding PopupPanel. 

Any ideas?


   Are you trying to run these widget in WAB 2.4?


Thanks for the reply. Not sure on the WAB version, but we're using Portal 10.5.1.


  I will try and do some testing with Portal (I don't currently use Portal). I was pretty sure that other have eSearch working in Portal though. 

I'm querying very a very large parcels dataset (~1.8M records) and the search fails sometimes.  Is there a timeout set to 1 minute or so for queries?  I upped the memory based on the AGS error, but it seems like the application is timing out before the server times out or reaches a limit.


   The default timeout used by the API is one minute. You would have to add 

esriConfig.defaults.io.timeout = 1800000; //Meaning wait 3 minutes

Thank you, that’s what I needed.


Can the enhanced search widget query a related table directly? After setting the data search URL input to the rest services URL of my related table I continue to receive a search failed! error when attempting to perform a search. I have had luck with using the "Add Relate" functionality however, this is insufficient for my needs because I need the "Search Expression" functionality to work with my related records alone. If this is not working by default, is there an easy code work-around?

Please excuse me if this question has already been answered - I had trouble finding the information. Thanks for all the great work Robert.


Version history
Revision #:
7 of 7
Last update:
‎11-16-2021 06:12 AM
Updated by: