Reusable Accessible Mapping Platform

API Docs for: 4.0.0
Show:

Datagrid Class

The Datagrid class represents the side bar table shown next to the map. The data grid displays all map objects in a text format and allows the user to see more details (same as clicking the map object) and navigate to the object. This class create the UI panel, events, and event-handles for the data grid container.

Methods

_hideLoadingImg

() private

Hides the loading image.

_initEventHandlers

(
  • map
)
private

Creates event handlers for the map control: click, mouse-over, load, extent change, and update events.

Parameters:

  • map Object

    A ESRI map object

_initListeners

(
  • map
)
private

Subscribe to external events (published using topic.publish) and react accordingly

Parameters:

_initRepublishers

(
  • map
)
private

Republishes map events to the outside using topic.publish

Parameters:

_initScale

(
  • event
)
private

Initialize Map Scale

Parameters:

_showLoadingImg

() private

Shows the loading image.

_toggleFullScreenMode

(
  • fullscreen
)

Toggles full screen mode

Parameters:

  • fullscreen Boolean

    true - full screen on; false - full screen off; undefined - toggle;

_updateScale

(
  • event
)
private

Update Map Scale when zoom level changes

Parameters:

activate

() private

Highlights the given graphic object using the specified cssClass.

AddStaticLayer

(
  • layer_type
  • layer_url
  • layer_op
)
private

Add a static, non-interactive Layer to the map

Parameters:

  • layer_type String

    A value which controls how the layer is going to be added to the map

  • layer_url String

    A URL pointing to a valid map service endpoint

  • layer_op Number

    A value between 0.0 and 1.0 which determines the transparency of the layer

adjustPanelWidth

()

Adjusts the width of the datagrid panel to accommodate the scrollbar.

applyExtentFilter

(
  • d
)

Gets all layer data in the current map extent that are visible, and put the data into the data grid.

Parameters:

  • d A Deferred object

cacheSortedData

() private

Caches the sorted data from datatables for feature click events to consume. Builds featureToPage as a mapping of (layerName,featureId) => page where layerName and featureId are strings and page is a zero based int.

capturePanel

()

publishes the subPanel_Capture event to the GUI class

checkBoundary

(
  • e
  • maxExtent
)
Esri/geometry/Extent

Given an ESRI Extent Object, returns a new ESRI Extent Object that contains the extent adjusted according to this map's maximum extent

NOTE: this method is currently unused!

Parameters:

  • e Esri/geometry/Extent

    the extent Object

  • maxExtent Esri/geometry/Extent

    the maximum extent

Returns:

Esri/geometry/Extent:

An adjusted extent, if the target extent is outside the boundary

createDatatable

() private

Creates a Data table based on the grid configuration specified in the application config object. See http://www.datatables.net/usage/columns for addition information on config parameters.

createExtent

(
  • extentConfig
  • sr
)
Esri/geometry/Extent private

Instantiates an extent from a JSON config object and spatial reference

Parameters:

Returns:

Esri/geometry/Extent:

An ESRI extent object based on the config data

createRowPrototype

(
  • cssClass
)
Object private

creates a datagrid row that has the following features: highlight for a give graphic un-highlight scroll to for a give graphic

Parameters:

  • cssClass String

    the style that highlights the row.

Returns:

Object:

an object containing features of a datagrid row

deactivate

() private

Removes a specified cssClass from a given graphic object in the data grid

fetchRecords

(
  • visibleFeatures
)
private

Populate the datagrid with data in visibleFeatures

Parameters:

  • visibleFeatures Array

    a dictionary mapping service url to an array of feature objects

fullScreenCallback

(
  • event
  • func
)
Object chainable

Allows to set callbacks to the full screen transition.

Parameters:

  • event String

    Event name to set a callback on

  • func Function

    A callback function

Returns:

Object:

This

generateToggleButtonDataForTemplate

() String private

Generates a data grid row data with a checkbox to be used in template

Returns:

String:

the generated row data object.

getDataObject

(
  • feature
)
private

Given a map feature, return a data object used to represent the feature in the datagrid.

Parameters:

  • feature Object

    the feature needs to be represented in the datagrid return {Array} an array representing the data the given feature contains.

getFeatureLayer

(
  • featureUrl
)
Esri/layer/FeatureLayer private

Return the feature layer corresponding to the given url.

Parameters:

  • featureUrl String

    the url of the feature layer

Returns:

Esri/layer/FeatureLayer:

feature layer

getGraphicFromButton

(
  • buttonNode
)
Object private

Returns the graphic object of a feature layer which is contained in the given buttonNode.

Parameters:

  • buttonNode JObject

    the node containing the feature layer

Returns:

Object:

the graphic object of the feature layer.

getGraphicTitle

(
  • graphic
)

Returns the content of the name field of the provided graphic object

Parameters:

  • graphic Esri/Graphic

    a graphic object or a feature object

Returns:

getGridConfig

(
  • url
)
Object

Returns the config Object for the given featureLayerUrl

Parameters:

Returns:

Object:

grid config

getLayerConfig

(
  • graphic
)
Esri/Graphic

Given a graphic object, returns the config object associated with the graphic's layer.

Parameters:

  • graphic Esri/Graphic

    a graphic object or a feature object

Returns:

Esri/Graphic:

getNode

() Node: jObject, page: number private

Finds a row node corresponding to the given graphic object.

Returns:

Node: jObject, page: number:

} A row node that displays graphic information. If none found, returns an object with empty jNode.

getOid

(
  • graphic
)

Returns the oid of the given graphic object

Parameters:

  • graphic Esri/Graphic

getTextContent

(
  • graphic
)
Object private

Get popup content for a graphic (i.e. a point) This logic is customized per project

Parameters:

Returns:

Object:

found graphic object

getVisibleFeatureLayers

() Array

Returns a list of feature layers that are currently visible on the map.

Returns:

Array:

an array of Esri/layer/FeatureLayer objects

handleGridEvent

(
  • e
  • callback
)
private

A handler that handlers the Enter key press and Click mouse event of the data grid. It is actually a binder that binds the key / mouse event to a handler specified. This is wired up to grid cells in the bootstrapper to achieve click/keypress functions

Parameters:

  • e Event

    the event object

  • callback Function

    the callback function

highlightrowHide

() private

Un-highlights the row that is currently highlighted

highlightrowShow

(
  • event
)
private

Highlights the row according to the graphic stored in the event. Sets the hightlightRow variable to the graphic object inside the sent event

Parameters:

  • event Object

    A thrown event that contains a graphic object inside the grid

init

()

Initialize the datagrid. must be called before any properties can be accessed.

init

()

The constructor method for the data grid. Adds the grid's panel to the UI, adds the data rows, and creates all event triggers

initListeners

() private

Binding event handling for events: filterManager/layer-visibility-toggled datagrid/applyExtentFilter

initScrollListeners

() private

Apply's or removes the scrollbar from the data grid based on the height of its container.

initTooltips

() private

Initialize tooltips for the data grid

initUIListeners

() private

Registers event handlers for following events: datagrid/highlightrow-show datagrid/zoomlightrow-show datagrid/zoomlightrow-hide

isFullScreen

() Boolean

Returns a boolean indication whether the full screen mode is on.

Returns:

Boolean:

true / false

isReady

() Boolean

Indicates that the Data grid is fully rendered

Returns:

Boolean:

_isReady flag indicating the render status of the data grid

navigateToRow

() Boolean private

Navigate to the page the row is in and scroll to it. Returns true if the row exists in the datagrid, false otherwise.

Returns:

Boolean:

A value indicating is the navigation is successful

newPopup

(
  • popupAttr
)
private

Create a new PopupBase object from the settings provided.

Parameters:

Returns:

popup

onDetailDeselect

()

This function is called whenever the "Details" button is deselected (either by the user click on another "Details" button, clicking on another point, or by clicking on an already highlighted "Details" button).

onDetailSelect

(
  • buttonNode
  • selectedGraphic
)

This function is called whenever the "Details" button is clicked in the datagrid.

Parameters:

  • buttonNode JObject

    the "Details" button node

  • selectedGraphic Object

    {esri/Graphic} the graphic object associated with the entry in the datagrid

onZoomBack

()

This function is called whenever the user clicks on the "Zoom Back" button.

onZoomCancel

()

Publishes new events when zoomCancel event happens. Following events are published: highlighter/zoomlight-hide datagrid/zoomlightrow-hide

onZoomTo

(
  • currentExtent
  • zoomToGraphic
)

This function is called whenever the user clicks on the "Zoom To" button.

Parameters:

  • currentExtent Esri/geometry/Extent

    the current extent of the map

  • zoomToGraphic Object

    graphic object of the feature to zoom to

refresh

() Node: jObject, page: number private

Finds a row node corresponding to the given graphic object.

Returns:

Node: jObject, page: number:

} A row node that displays graphic information. If none found, returns an object with empty jNode.

republish

(
  • name
)
private

Republish map events using topic.publish

Parameters:

setBoundingBoxVisibility

(
  • layerId
)
private

Sets the visibility of the bounding box that belongs to the layer with the given layerId. Note: the layerId needs to be the ID of the featurelayer, not the ID of the actual bounding box layer.

Parameters:

  • layerId String

    the id of the layer whose bounding box visibility should be set

setButtonEvents

() private

Adds event-handling for buttons inside the data grid's row elements (i.e 'Details', 'Zoom To' buttons)

toggleFullScreenMode

(
  • fullscreen
)
Object chainable

Toggles the FullScreen mode of the application

Parameters:

  • fullscreen Boolean

    true - expand; false - collapse; undefined - toggle;

Returns:

Object:

This

tooltipster

(
  • target
  • type
  • [action]
)
Object chainable

Tooltip setter helper method.

Parameters:

  • target Jquery

    A node to looked for tooltiped children on

  • type String

    Type of the tooltips to set

  • [action] String optional

    Action name: "update" will update all the tooltips on target with their respective title attributes; null will create new tooltips

Returns:

Object:

This

zoomlightrowHide

() private

De-activates the row stored in zoomlightRow

zoomlightrowShow

(
  • event
)
private

Stores the graphic in the given event in the variable zoomlightRow

Parameters:

  • event Object

    A thrown event that contains a graphic object inside the grid

Properties

baseLayer

Esri/layers/ArcGISTiledMapServiceLayer private

The basemap layer

boundingBoxLayers

Array of esri/layer/GraphicsLayer

A list GraphicsLayer that represent the extent bounding box of the feature layers. {[esr/layer/featurelayers]} featureLayers A list of feature layers found in the application config {[esri/layer/graphiclayer]} An array of graphic layers to add to the map

boundingBoxMapping

Object private

Maps the id of a graphic layer to the GraphicsLayer Object that represents its extent bounding box. A dictionary of String, Esri/layer/GraphicsLayer pairs.

featureLayers

Array private

An Array of Esri/layer/FeatureLayer objects.

featureLayerStartIndex

Integer private

The map not only contains feature layers, but also other layers such as the basemap layer, highlight layer, bounding box layer, etc. This variable is used to store the starting index of the feature layers in the map.

featureOidField

Unknown private

Name of the attribute used to store the oid in the details and zoomTo buttons

featureUrlField

Unknown private

Name of the attribute used to store the feature url in the details and zoomTo buttons

fullExtent

Esri/geometry/Extent private

Used for full extent in nav widget

getMap

Object

Return the map control object

getMaxExtent

Object

The maximum extent of the map control is allowed to go to

InitExtent

Esri/geometry/Extent private

The initial extent of the map

maxExtent

Esri/geometry/Extent private

The maximum extent of the map

oTable

Unknown private

The jquery table

spatialReference

Esri/SpatialReference private

The spatial reference of the map

totalRecords

Unknown private

Total number of features in all the visible layers on the map

url

String private

The URL of the basemap that is on by default

wmsLayers

Array private

An Array of Esri/layer/WMSLayer objects.

Events

advanced.ADVANCED_PANEL_CHANGED

Provided by the UI module.

Defined in src\js\RAMP\Modules\eventManager.js:655

Published whenever the user clicks on the get link button in the map toolbar.

datagrid.APPLY_EXTENT_FILTER [subscribed]

Provided by the UI module.

Defined in src\js\RAMP\Modules\eventManager.js:556

Applies a spatial filter to the datagrid (i.e. only visible points in the current extent will be displayed in the datagrid)

datagrid.DRAW_COMPLETE

Provided by the UI module.

Defined in src\js\RAMP\Modules\eventManager.js:565

Fires when the table has finished drawing

datagrid.EXTENT_FILTER_END

Provided by the UI module.

Defined in src\js\RAMP\Modules\eventManager.js:572

Fires when the extent-filter has finished updating

datagrid.HIGHLIGHTROW_HIDE

Provided by the UI module.

Defined in src\js\RAMP\Modules\eventManager.js:588

Dehighlights the currently highlighted row.

datagrid.HIGHLIGHTROW_SHOW

Provided by the UI module.

Defined in src\js\RAMP\Modules\eventManager.js:579

Highlights the row corresponding to the given graphic object of the selected feature.

Event Payload:

  • event Object
    • graphic Object

      ESRI graphic object corresponding to the selected feature

datagrid.ZOOMLIGHTROW_HIDE

Provided by the UI module.

Defined in src\js\RAMP\Modules\eventManager.js:603

Dehighlights the currently zoomlighted row.

datagrid.ZOOMLIGHTROW_SHOW

Provided by the UI module.

Defined in src\js\RAMP\Modules\eventManager.js:594

Zoomlights the row corresponding to the given graphic object of the zoomed to feature.

Event Payload:

  • event Object
    • graphic Object

      ESRI graphic object corresponding to the zoomed to feature

Navigation.FULL_EXTENT

Provided by the UI module.

Defined in src\js\RAMP\Modules\eventManager.js:635

Published whenever the user clicks on the full extent button in the navigation widget.

Navigation.PAN

Provided by the UI module.

Defined in src\js\RAMP\Modules\eventManager.js:614

Published whenever the user clicks on the pan buttons.

Navigation.ZOOM

Provided by the UI module.

Defined in src\js\RAMP\Modules\eventManager.js:628

Published whenever the user tries to zoom using the slider.

Navigation.ZOOM_STEP

Provided by the UI module.

Defined in src\js\RAMP\Modules\eventManager.js:621

Published whenever the user tries to zoom using the arrow buttons.