API Docs for: 0.0.8-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 conatiner.

Methods

activate

() private

Highlights the the given graphic object using the specified cssClass.

activateRows

()

Navigates the grid to a row. Based on the following precedent: 1. User selected point, 2. Highlighted row, 3. zoomed row, 4. first row in the grid.

adjustPanelWidth

()

Adjusts the width of the data grid panel to accommodate the scrollbar.

applyExtentFilter

()

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

capturePanel

()

publishes the subPanel_Capture event to the GUI class

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.

createRowPrototype

(
  • cssClass
)
Object private

Creates a data grid 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 data grid row

deactivate

() private

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

featureSorter

(
  • e1
  • e2
)
Integer private

Sort by feature name, then by oid, then by feature url (alphabetically ascending)

Parameters:

Returns:

Integer:

a positive integer if e1 is greater (in sort order) than e2, a negative integer if e2 is greater than e1, 0 if the two are considered equal by sort order

fetchRecords

(
  • visibleFeatures
)
private

Populate the data grid with data in visibleFeatures

Parameters:

  • visibleFeatures Array

    a dictionary mapping service url to an array of feature objects

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 data grid.

Parameters:

  • feature Object

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

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.

getGraphicIndex

(
  • graphic
)
private

Returns the index of the given graphic object in the data grid

Parameters:

getGraphicTitle

(
  • graphic
)

Parameters:

  • graphic Object

    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 Object

    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:

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

handleGridEvent

(
  • e
  • fcn
)
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

  • fcn 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

()

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 filterManager/global-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 (!!2 handlers for this event!!) datagrid/zoomlightrow-show datagrid/zoomlightrow-hide

isReady

() Boolean

Indicates that the Data grid is fully rendered

Returns:

Boolean:

A 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 data grid, false otherwise.

Returns:

Boolean:

A value indicating is the navigation is sucessful

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

onHide

() private

Removes the animating CSS class to prevent flickering

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

setButtonEvents

() private

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

sortFcns

(
  • e1
  • e2
)
Array

Sorts by layer name then by feature (alphabetically ascending)

Parameters:

Returns:

Array:

A array of sorted objects

update

() 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.

zoomlightrowHide

() private

De-activiates 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

Attributes

getConfigUrl

readonly

Returns a URL that points to the application configuration (JSON format) if it's hosted on a web service. This is not required if the application has a JSON config file in the website's folder

Events

bookmark.events.GETLINKPANEL_CHANGED

Provided by the UI module.

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

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

datagrid.events.APPLY_EXTENT_FILTER [subscribed]

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:532

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

datagrid.events.DRAW_COMPLETE

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:541

Fires when the table has finished drawing

datagrid.events.EXTENT_FILTER_END

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:548

Fires when the extent-filter has finished updating

datagrid.events.HIGHLIGHTROW_HIDE

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:564

Dehighlights the currently highlighted row.

datagrid.events.HIGHLIGHTROW_SHOW

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:555

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.events.ZOOMLIGHTROW_HIDE

Provided by the UI module.

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

Dehighlights the currently zoomlighted row.

datagrid.events.ZOOMLIGHTROW_SHOW

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:570

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.events.FULL_EXTENT

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:611

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

Navigation.events.PAN

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:590

Published whenever the user clicks on the pan buttons.

Navigation.events.ZOOM

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:604

Published whenever the user tries to zoom using the slider.

Navigation.events.ZOOM_STEP

Provided by the UI module.

Defined in javascript\src\RAMP\Modules\eventManager.js:597

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