How to Search and Zoom programmatically ( with Webapp Builder v1.2)

2855
2
Jump to solution
09-15-2015 03:04 PM
SowjanyaSunkara3
New Contributor III

Whatever the Search Widget does after configuration, can it be done behind the scenes?

1.Can I setup a search Widget to read from a Config file (lets say, config file has Map service URLs, Field to search on)

2. And then search and zoom ( by calling the Search/Find Dijit?)

0 Kudos
1 Solution

Accepted Solutions
ZeZhengLi
Esri Contributor

Sowjanya,

     I think you can use search widget to search something behind the scenes like this code snippet.

searchWidgets = widgetManager.getWidgetsByName("Search");
if (searchWidgets.length > 0) {
  var search1 = searchWidgets[0];
  if (search1 && search1.searchDijit) {
  search1.searchDijit.search(text);
  }
}

View solution in original post

2 Replies
ZeZhengLi
Esri Contributor

Sowjanya,

     I think you can use search widget to search something behind the scenes like this code snippet.

searchWidgets = widgetManager.getWidgetsByName("Search");
if (searchWidgets.length > 0) {
  var search1 = searchWidgets[0];
  if (search1 && search1.searchDijit) {
  search1.searchDijit.search(text);
  }
}
SowjanyaSunkara3
New Contributor III

Thank you!

0 Kudos