I need to add some additional functionality to a map, namely the search widget. To keep the screen open, I want to use Expand with it. However, as soon as I add Expand in, the search widget no longer functions properly. The widget stays collapsed and never allows the user to search. Here's that portion of my code. Am I missing something?
//Add search widget
var searchWidget = new Search({
view: view,
});
var searchExpand = new Expand({
view: view,
content: searchWidget.domNode,
expandIconClass: "esri-icon-search"
});
// Add the search widget to the top left corner of the view
view.ui.add(searchExpand, "top-right");
Thanks in advance for any guidance!
Ashley
Solved! Go to Solution.
Ashley,
You need to add the whole search widget as the expands content not just the domNode.
var searchExpand = new Expand({
view: view,
content: searchWidget,
expandIconClass: "esri-icon-search"
});
Ashley,
You need to add the whole search widget as the expands content not just the domNode.
var searchExpand = new Expand({
view: view,
content: searchWidget,
expandIconClass: "esri-icon-search"
});
Thanks Robert! That was my problem.