require(["esri/dijit/geoenrichment/DataBrowser"], function(DataBrowser) { /* code goes here */ });
Description
(Added at v3.11)
The DataBrowser widget allows users to search or browse for geoenrichment variables.
Samples
Search for
samples that use this class.
Constructors
CSS
esri/dijit/geoenrichment/DataBrowser | Download source
Properties
Methods
startup() | None | Finalizes the creation of the DataBrowser. |
Events
[ On Style Events | Connect Style Event ]
All On Style event listeners receive a single event object. Additionally, the event object also contains a 'target' property whose value is the object which fired the event.
Events
back | | Fires when user clicks the Back button. |
cancel | | Fires when user clicks the Cancel button. |
ok | | Fires when user clicks the OK button. |
select | | Fires when variables are selected. |
Old Events
onBack() | Fires when user clicks the Back button. |
onCancel() | Fires when user clicks the Cancel button. |
onOK() | Fires when user clicks the OK button. |
onSelect() | Fires when variables are selected. |
Constructor Details
Creates a new DataBrowser dijit using the given DOM node.
Parameters:
<Object > options |
Required |
Optional parameters used to create the layer. See options descriptions for further information. |
<Node | String > srcNodeRef |
Required |
Reference or id of an HTML element where the DataBrowser should be rendered. |
options
properties:
<Boolean > allowHierarchies |
Optional |
Whether or not to display the hierarchy dropdown for countries with multiple hierarchies (for example USA has both Census and Landscape, Germany has both Census and Nexiga). Defaults to false. |
<Boolean > countryBox |
Optional |
Show/hide country drop down. Defaults to true. |
<String > countryID |
Optional |
Two-digit country code selected in the country drop down. Defaults to null which will show "Global" variables available for all countries. |
<String > hierarchyID |
Optional |
The hierarchy to load for a country (for example 'Census' or 'Landscape' for USA). Defaults to null which will load all hierarchies for a country. |
<String > pageBackButton |
Optional |
Text string to display on the back button on the second and third pages of the Data Browser. Default depends on locale; for en-us it is "Back". |
<String[] > selection |
Optional |
Selected variables array. Each item is full name like "KeyGlobalFacts.TOTPOP" |
<Boolean > shoppingCart |
Optional |
Whether to display the "Shopping Cart" of selected variables. |
<String > title |
Optional |
Title to show in the top left hand corner. Defaults to "Data Browser". |
Sample: var dataBrowser = new DataBrowser({
countryID: "US",
okButton: "Yes",
backButton: "Back",
cancelButton: "No",
onSelect: function() {
console.log("Selected variables: " + dataBrowser.get("selection"));
},
onOK: function() {
console.log("OK clicked");
},
onCancel: function() {
console.log("Cancel clicked");
},
onBack: function() {
console.log("Back clicked");
}
}, "dataBrowser");
Property Details
An array of the variables currently loaded in the Data Browser. (Added at v3.16)
Method Details
Finalizes the creation of the DataBrowser. Call startup() after creating the widget.
Sample: dataBrowser.startup();
Event Details
[ On Style Events | Connect Style Event ]
Fires when user clicks the Back button.
Fires when user clicks the Cancel button.
Fires when user clicks the OK button.
Sample: dataBrowser.on("ok", function () {
alert("Selected variables: " + dataBrowser.get("selection"));
});
Fires when variables are selected.
Fires when user clicks the Back button.
Fires when user clicks the Cancel button.
Fires when user clicks the OK button.
Fires when variables are selected.