Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Class: DataBrowser

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

NameSummary
new DataBrowser(options, srcNodeRef)Creates a new DataBrowser dijit using the given DOM node.

CSS

esri/dijit/geoenrichment/DataBrowser | Download source

Properties

NameTypeSummary
variablesObject[]An array of the variables currently loaded in the Data Browser.

Methods

NameReturn typeSummary
startup()NoneFinalizes 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

NameEvent ObjectSummary
backFires when user clicks the Back button.
cancelFires when user clicks the Cancel button.
okFires when user clicks the OK button.
selectFires when variables are selected.
Constructor Details

new DataBrowser(options, srcNodeRef)

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"
<Number> selectionLimit Optional The maximum number of variables to select.
-1 means unlimitted number of variables to select.
0 means no selection. In this case, selection check boxes and shopping cart are missing.
1 means a single selection mode. In this case, selection check boxes and shopping cart are missing and the initial selection is ignored.
<Boolean> shoppingCart Optional Whether to display the "Shopping Cart" of selected variables. Note: The selectionLimit property must also be set for the shopping cart to function.
<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

<Object[]> variables

An array of the variables currently loaded in the Data Browser. (Added at v3.16)
Method Details

startup()

Finalizes the creation of the DataBrowser. Call startup() after creating the widget.
Sample: dataBrowser.startup();
Event Details
[ On Style Events | Connect Style Event ]

back

Fires when user clicks the Back button.

cancel

Fires when user clicks the Cancel button.

ok

Fires when user clicks the OK button.
Sample: dataBrowser.on("ok", function () { alert("Selected variables: " + dataBrowser.get("selection")); });

select

Fires when variables are selected.
Show Modal