laptop and a wrench

Bug

The suggestQueryParams property of the Search widget does not work as expected.

Last Published: August 2, 2017 ArcGIS API for JavaScript
Bug ID Number BUG-000104601
SubmittedApril 20, 2017
Last ModifiedJune 5, 2024
Applies toArcGIS API for JavaScript
Version found3.20
Operating SystemWindows OS
Operating System Version10.0 64 Bit
Version Fixed4.4
StatusFixed

Workaround

In versions 3.20 and 4.3, use the esriRequest.setRequestPreCallback to append the needed SQL to the queryTask generated by the Search widget. Samples of both these workflows are below. // Version 3.20<a href="http://jsbin.com/kevewef/2/edit?js,output" target="_blank">http://jsbin.com/kevewef/2/edit?js,output</a> // Version 4.30<a href="http://jsbin.com/yulejo/2/edit?js,output" target="_blank">http://jsbin.com/yulejo/2/edit?js,output</a>In addition to the above workarounds there are also workarounds for specific versions. In version 3.20, leverage a defintionQuery against the FeatureLayer used in the Search widget. The definitionQuery was automatically appended to the QueryTask sent by the Search widget. Version 3.20<a href="http://jsbin.com/ramime/1/edit?js,output" target="_blank">http://jsbin.com/ramime/1/edit?js,output</a>In version 4.3 post-process the Suggestions by wiring into the suggest-complete event and removing the un-needed suggestions from the results array. Version 4.3<a href="http://jsbin.com/qobaji/5/edit?js,output" target="_blank">http://jsbin.com/qobaji/5/edit?js,output</a>

Steps to Reproduce

Bug ID: BUG-000104601

Software:

  • ArcGIS API for JavaScript

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options