Hello,
I would like to modify the Search Widget available in WAB so that I can select values within a layer.
I currently have the search box set up to search a layer by the field "name" when typed in the text box, but I would like these names available in a drop-down menu. I have attempted to rearrange code and use bits from other widgets that contain drop-downs but I receive errors.
Current html code for search widget (out of the box from ESRI):
<div>
<div data-dojo-attach-point="searchNode" class="search-node"></div>
<div data-dojo-attach-point="searchResultsNode" class="searchResults arcgisSearch"></div>
</div>
Code containing the drop-down function (from eSearch widget by Robert Scheitlin, GISP) :
<select class="esearch-select" style="margin-bottom:10px;float:left;"
data-dojo-attach-point="selectLayerGraphical" data-dojo-type="dijit/form/Select"></select>
<div data-dojo-type="dijit/form/DropDownButton" data-dojo-attach-point="gSelectType" iconclass="newSelIcon"
class="selectionmenu"><span></span>
How would I be able to use the 2nd to modify the 1st?..correctly
Thank you!
F Blanchard,
If you are using ArcGIS server 10.3.1 or greater then the search widget will provide a drop down list of suggestions automatically. Short of this you are on your own. The reason my eSearch provides a drop down list is because I have a completely different code base that performs queries on the map service data to be unique values from the map service layer field. There is no simple add a couple of lines of code and your done.
Thank you Robert. I appreciate your reply.
Yes I am using 10.4. Naively I thought it would be as simple as just changing the box type in the html file. I am quickly learning these develops are not so easy. I am very new to widgets and app modifications.
Thanks a bunch!