undefined

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

Imports RAMP Modules:

RAMP GraphicExtension GlobalStorage DatagridClickHandler Map EventManager Theme Util Array Dictionary PopupManager TmplHelper

Uses RAMP Templates:

templates/datagrid_template.json templates/extended_datagrid_template.json

Methods

activate

() private

Highlights this row using the specified cssClass.

adjustPanelWidth

()

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

applyExtentFilter

(
  • d
)

Rounds up all visible features in the current map extent, then triggers the process to add those features to the datagrid

Parameters:

  • d Deferred

    a deferred to resolve after the grid has been populated

capturePanel

(
  • force
)
private

Captures a subpanel that was opened and docked by the datagrid module previously.

Parameters:

  • force Boolean

    if truthy - capture the panel even if the datagrid is not visible; use when switching to datagrid tab and the datagrid is not fully rendered yet by the browser

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://datatables.net/reference/option/ for addition information on config parameters.

createRowPrototype

(
  • cssClass
)
Object private

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

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 this row in the data grid

fetchRecords

(
  • visibleFeatures
)
private

Populate the datagrid with data belonging to features contained in visibleFeatures

Parameters:

  • visibleFeatures Array

    a dictionary mapping layer id to an array of on-map feature objects

getDataObject

(
  • fData
)
private

Given a feature data object, return a data object used to represent the feature in the datagrid. The data object is an ordered array of raw values

Parameters:

  • fData Object

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

getFDataFromButton

(
  • buttonNode
)
Object private

Returns the feature data object which is encoded in the given buttonNode.

Parameters:

  • buttonNode JObject

    the node containing the button

Returns:

Object:

the feature data object

getGraphicFromFData

(
  • fData
)
Object private

Returns the graphic object of a feature layer for the corresponding feature data object.

Parameters:

  • fData Object

    a feature data object

Returns:

Object:

the graphic object of the feature layer.

getNode

() Node: jObject, page: number private

Finds a row node corresponding to this object.

Returns:

Node: jObject, page: number:

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

handleGridEvent

(
  • e
  • callback
)
private

Handles 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

indexSortedData

() private

Caches the sorted data from datatables for feature click events to consume. Builds featureToIndex as a mapping of (layerId,featureId) => row index in the table.

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

init

()

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

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

isReady

() Boolean

Indicates that the Data grid is fully rendered

Returns:

Boolean:

_isReady flag indicating the render status of the data grid

isVisible

() Boolean private

Checks if the datagrid currently visible, i.e., the data tab is selected on the side panel

Returns:

Boolean:

indicating if the datagrid is currently visible

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

refresh

() Node: jObject, page: number private

Refresh the page index of this row

Returns:

Node: jObject, page: number:

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

rowRenderer

(
  • data
  • type
  • row
  • meta
)
private

Generates the content for a grid cell. Will use template engine the first time, cached value after that. Function must conform to datatables renderer api https://datatables.net/reference/option/columns.render

Parameters:

  • data Object

    the data for this cell that was added to the grid. not used

  • type String

    the type of request. not used

  • row Array

    full data values for the current row

  • meta Object

    additional information about the cell return {String} value to display in the given grid cell

setButtonEvents

() private

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

updateDatasetSelectorState

(
  • state
  • [loaded]
)

Updates the state of the dataset selector based on whether the dataset has been loaded and what dataset is currently selected.

Parameters:

  • state Boolean

    indicates if button is disabled or not; true - disabled;

  • [loaded] Boolean optional

    indicates if the selected dataset is already loaded; it's assumed to be loading otherwise

updateNotice

() private

Update the datagrid notice to show feedback to the user if any. Right now is used to display notifications about scale dependent layers that are off scale at the moment.

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

featureOidField

Unknown private

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

layerIdField

Unknown private

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

oTable

Unknown private

The jquery table

totalRecords

Unknown private

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

Events

Datagrid.APPLY_EXTENT_FILTER [subscribed]

Provided by the UI module.

Defined in src/js/RAMP/Modules/eventManager.js:695

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:704

Fires when the table has finished drawing

Datagrid.EXTENT_FILTER_END

Provided by the UI module.

Defined in src/js/RAMP/Modules/eventManager.js:711

Fires when the extent-filter has finished updating

Datagrid.HIGHLIGHTROW_HIDE

Provided by the UI module.

Defined in src/js/RAMP/Modules/eventManager.js:727

Dehighlights the currently highlighted row.

Datagrid.HIGHLIGHTROW_SHOW

Provided by the UI module.

Defined in src/js/RAMP/Modules/eventManager.js:718

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

Event Payload:

  • event Object
    • fData Object

      feature data object corresponding to the selected feature

Datagrid.UPDATING

Provided by the UI module.

Defined in src/js/RAMP/Modules/eventManager.js:750

Is fired by the state manager when datagrid is being updated.

Event Payload:

  • event Boolean

    true if updating; false if not

Datagrid.ZOOMLIGHTROW_HIDE

Provided by the UI module.

Defined in src/js/RAMP/Modules/eventManager.js:742

Dehighlights the currently zoomlighted row.

Datagrid.ZOOMLIGHTROW_SHOW

Provided by the UI module.

Defined in src/js/RAMP/Modules/eventManager.js:733

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

Event Payload:

  • event Object
    • fData Object

      feature data object corresponding to the zoomed to feature