Class jMatrixBrowseNs.Configuration
Configuration
Defined in: Configuration.js.
Constructor Attributes | Constructor Name and Description |
---|---|
jMatrixBrowseNs.Configuration(elem, api)
Manages configurations for jMatrixBrowse.
|
Method Attributes | Method Name and Description |
---|---|
<inner> |
extendDefaults(options)
Extend the user's settings with defaults.
|
getCellWindow(position)
Get the window end points which has given point at its top left corner.
|
|
Gets the number ata reload strategy to use.
|
|
Gets the number of background cells to use.
|
|
Gets settings object.
|
|
<inner> |
getUserOptions(elem)
Get user defined options from data-* elements.
|
Gets position of window.
|
|
Gets window size from settings.
|
|
<inner> |
setSettings(settings)
Set the settings object.
|
setWindowSize(size)
Sets window size.
|
|
<inner> |
validate(options)
Validates the options defined by the user.
|
Class Detail
jMatrixBrowseNs.Configuration(elem, api)
Manages configurations for jMatrixBrowse.
- Parameters:
- {jQuery Object} elem
- - element that initiated jMatrixBrowse.
- {Object} api
- - api manager for making requests to api.
Method Detail
<inner>
{Object, boolean, string, string, string}
extendDefaults(options)
Extend the user's settings with defaults.
- Parameters:
- options
- Returns:
- {Object} options - User's options for the plugin.
- {boolean} options.boo_jMatrixBrowser - Is jMatrixBrowse active for the container.
- {string} options.str_api - URI for the API.
- {string} options.str_initialWindowSize - comma separated window size as (width, height).
- {string} options.str_initialWindowPosition - comma separated window position as (row,col).
{Object, Number, Number, Number, Number}
getCellWindow(position)
Get the window end points which has given point at its top left corner.
- Parameters:
- {Object} position
- - position of the cell.
- {Number} position.row
- - row of the cell.
- {Number} position.col
- - column of the cell.
- Returns:
- {Object} window - Object representing the window coordinates.
- {Number} window.row1 - row index of the top left corner.
- {Number} window.col1 - column index of the top left corner.
- {Number} window.row2 - row index of the bottom right corner.
- {Number} window.col2 - column index of the bottom right corner.
getDataReloadStrategy()
Gets the number ata reload strategy to use.
- Returns:
- dataReloadStrategy Reload strategy (possible options defined in Constants)
getNumberOfBackgroundCells()
Gets the number of background cells to use.
- Returns:
- nBackgroundCells The number of background cells.
{Object}
getSettings()
Gets settings object.
- Returns:
- {Object} User settings for jMatrixBrowse. See (https://github.com/pulkit110/jMatrixBrowse/wiki/Use) for list of available settings.
<inner>
{Object, boolean, string, string, string}
getUserOptions(elem)
Get user defined options from data-* elements.
- Parameters:
- {jQuery object} elem
- - the element to retrieve the user options from.
- Returns:
- {Object} options - User's options for the plugin.
- {boolean} options.boo_jMatrixBrowser - Is jMatrixBrowse active for the container.
- {string} options.str_api - URI for the API.
- {string} options.str_initialWindowSize - comma separated window size as (width, height).
- {string} options.str_initialWindowPosition - comma separated window position as (row,col).
{Object, Number, Number}
getWindowPosition()
Gets position of window.
- Returns:
- {Object} position - position of the top-left corner of window.
- {Number} position.row - row index of the position.
- {Number} position.col - column index of the position.
{Object, Number, Number}
getWindowSize()
Gets window size from settings.
- Returns:
- {Object} size - size of the window.
- {Number} size.width - width of the window.
- {Number} size.height - height of the window.
<inner>
setSettings(settings)
Set the settings object.
- Parameters:
- {Object} settings
setWindowSize(size)
Sets window size.
- Parameters:
- {Object} size
- - size of the window.
<inner>
{Boolean}
validate(options)
Validates the options defined by the user.
- Parameters:
- {Object} options
- - User's options for the plugin.
- Returns:
- {Boolean} true if the options are valid.