AnsweredAssumed Answered

[4.3]-How to modify the placeholder for Search widget?

Question asked by leo.deng.transfinder on Jun 2, 2017
Latest reply on Jun 2, 2017 by hzhu

I'm trying to modify the placeholder for search widget. But the attribute allPlaceholder seems invalid.

What's wrong with my scripts?

 

Version of ArcGIS API for JavaScript : 4.3

 

<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='initial-scale=1, maximum-scale=1, user-scalable=no'>
<title>Create a map</title>
<style>
html, body, #viewDiv{
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.3/esri/css/main.css">
<script src="https://js.arcgis.com/4.3/"></script>
<script>
require([
'esri/Map',
'esri/views/MapView',
'esri/widgets/Search',
'dojo/domReady!'], function(Map, MapView, Search){
var map = new Map({
basemap: 'streets'
});

var view = new MapView({
container: 'viewDiv',
map: map,
zoom: 10,
center: [-73.939501, 42.818609]
});

var searchWidget = new Search({
id: 'searchWidget',
view: view,
allPlaceholder: 'Search Location', // invalid
popupEnabled: false
});

view.ui.add(searchWidget, {
position: 'top-right', // top-left | top-right | bottom-left | bottom-right | manual (default)
index: 2
});
});
</script>
</head>
<body>
<div id='viewDiv'></div>
</body>
</html>

Outcomes