Component_DataGridBehavior Class
The data-grid behavior component defines the logic for a data-grid. A data-grid allows to display items from a associated data-source using a specified item-template. Unlike a stack-layout, a data-grid is optimized to display even high amounts of items but they all need to use the same item-template with same size.
Item Index
Properties
Methods
onDataBundleRestore.
-
Object
-
gs.ObjectCodecContext
Called if this object instance is restored from a data-bundle. It can be used re-assign event-handler, anonymous functions, etc.
Parameters:
-
Object
Objectdata - The data-bundle
-
gs.ObjectCodecContext
Objectcontext - The codec-context.
resize
()
Resizes the data-grid and creates the necessary display objects from the data-grid template.
setup
()
Sets up the data-grid.
setupEventHandlers
()
Adds event-handlers for mouse/touch events
update
()
Updates the data-grid.
updateScroll
()
Updates scrolling.
Properties
columns
Number
Numbers of columns.
dataSource
Object | String
The data-source used for the data-grid. Can be an array or a formula.
initialized
Boolean
protected
Indicates if the data-grid is initialized and ready for rendering.
items
gs.Object_Base
protected
Stores the item-objects needed for rendering. They are created from the item-template.
spacing
Number
Defines a horizontal and vertical spacing between items.
Default: [0, 10]
template
Object
The item-template descriptor used for each item of the data-grid.