MAF.control.Grid
Basically the same as MAF.element.Grid, with the exception that this has default styling.
new MAF.control.Grid()
Methods
attachAccessories(arguments) inherited
Attach multiple accessory components to this component.
Parameters:
Name Type Description arguments Array Contains muliple accessory components.
Returns:
This component.
attachAccessory(accessory) inherited
Attach a accessory component to this component so it can update on grid events.
Parameters:
Name Type Description accessory Class The accessory component.
Returns:
This component.
blurCell() inherited
Blur focus of the given parameter target, which can be a cell, an index, or coordinates of where to blur focus.
Returns:
This component.
changeDataset(data, reset, dataLength) → {MAF.element.Grid} inherited
Parameters:
Name Type Argument Default Description data Array Data objects that will change the content of the grid.
reset Boolean optional false This will reset the page the grid will display to 0 when true.
dataLength Number optional When the dataset will be larger then the passed in array in length.
Fires:
Returns:
changePage(pagenum, options) inherited
Change page of the grid.
Parameters:
Name Type Description pagenum Number Number of the page to change to.
options Object Options to change the state of the grid.
focus() inherited
Give the grid focus.
focusCell(target) inherited
Change focus to the given parameter target.
Parameters:
Name Type Description target Mixed Can be a cell, an index, or coordinates of where to set focus
Returns:
This component.
freeze() → {Class} inherited
Freezes this component. Screen renders no longer trigger until thawed.
Returns:
This component.
getAbsolutePosition() → {Object} inherited
Give back the position relative to its first positioned ancestor element
Returns:
{hOffset:Number, vOffset: Number}
getCellCount() → {Number} inherited
Returns the cell count of a fully populated grid page. Returns this.config.rows * this.config.columns.
Returns:
The total number of cells on a grid page.
getCellDataIndex(c) → {Number} inherited
Parameters:
Name Type Description c Object | Number Can be a Cell, index or a row.
Returns:
Dataset Index.
getCellDataItem(c) → {Mixed} inherited
Parameters:
Name Type Description c Mixed Can be a cell, index, or row.
Returns:
Returns a dataset item.
getCellDimensions() → {Object} inherited
Returns:
With the width and height of the cells for the grid.
getCellIndex(a, b) → {Number} inherited
Parameters:
Name Type Description a Object | Number Can be a Cell, index or a row.
b Number Row
Returns:
Index of the cell if found. Otherwise it returns -1.
getCurrentPage() inherited
Returns:
The zero-based index of the current page of data.
getDataItem(index) → {object} inherited
Get the data item with the specified index.
Parameters:
Name Type Description index index The index of the data item to find.
Returns:
The data item with the passed index.
getFocusCoordinates() → {Object} inherited
Returns:
Row and column properties of the last focused cell.
getFocusIndex() inherited
Returns:
Index of last focused cell.
getPageCount() inherited
Returns:
this.pager.getNumPages(). The number of pages in the dataset.
getStartIndex() inherited
Returns:
The dataset index of the first cell on the current page.
getView() → {Class} inherited
Returns:
Returns the view this class is appended on.
getVisibleCellCount() inherited
Returns the cell count of currently visible cells.
hide() → {Class} inherited
Hides this component.
Returns:
This component.
initialize() inherited
Initialize the class
normalizeIndex() → {Number} inherited
Returns:
Starting index of the page containing the desired data item.
releaseFocus(direction, event) → {boolean} inherited
- Deprecated This will probably be removed in the next major MAF release.
Parameters:
Name Type Argument Description direction string The direction to release the focus too.
event event optional Returns:
Always will return true now.
setFilter(fn) inherited
Parameters:
Name Type Description fn function A function used as a test for each element in the data set.
Example
grid.setFilter(function (value) { if (value.type === 'demo') return value; });
shift(type, options) inherited
Shifts the grid to the page based on the parameter type.
Parameters:
Name Type Description type String You can use:
- first - Shift grid to the first page.
- last - Shift grid to the last page.
- up - Shift grid to the previous page.
- down - Shift grid to the next page.
- left - Shift grid to the previous page.
- right - Shift grid to the next page.
options Object Options to change the state of the grid.
show() → {Class} inherited
Shows this component.
Returns:
This component.
thaw() → {Class} inherited
Thawes this component. Screen renders can trigger again.
Returns:
This component.
Events
onAnimationEnded
Fired when a animation on this component has ended.
onAppend
Fired when component has appended to a parent. Update visual appearances by applying a Theme style and rendering the skin.
onBlur
Fired when the component is blurred.
onChangeDisabled
Fired when this component changes it enabled or disabled state.
onChangePage
Fired before a page on the grid will be changed.
onDatasetChanged
Fired when the data set of the grid has changed.
onDisable
Fired when this component changes it state to disabled.
onEnable
Fired when this component changes it state to enabled.
onFocus
Fired when the component recieves focus.
onNavigate
Fired when a navigation happens when the component has focus.
onPageChanged
Fired after a page on the grid has changed.
onSelect
Fired when the component is selected.
onStateUpdated
Fired when state of the grid is updated/changed.